Up Prev Next
From: Michael Peppler <mpeppler at MBAY dot NET>
Subject: out of sync message
Date: Jun 4 1998 3:33PM
Simon Yaminian writes:
> I used the dbh->freebuf call in an effort to possibly alleviate the problems I had with out of sync processing. It was mostly a shoot in the dark but I also used it to free the command buffer after cancelling the current command batch to get it reset for the next one.
> What I would like to be able to do is to break an ongoing batch of
> commands that are submitted for execution through dbh->sqlexec call no matter
> what stage it is in without adversely impacting any of the control information
> that Sybperl is keeping track of. Another words, I want to do a break and reset
> providing that the command batch is not doing any updates or inserts to the
> data base even if it does, I would like to know if this is feasible before
> commiting the updates.
It looks like you should be wrapping your SQL in transactions instead.
dbcancel() or dbcanquery() can't interrupt a query that is currently
running (at least I don't think that they can).
The real way to do this would be to install an interupt handler via
dbsetinterupt() and have that handler return INT_CANCEL if it wants
the current SQL batch to be interupted. Unfortunately Sybperl does not
support dbsetinterupt() at this time, so you can't really interupt a
batch the way you can in isql (with Control-C).
> In the meantime, I am getting the messages below possibly as a result
> of dbcancel or dbcanquery. I was still getting them even without the dbfreebuf
> Sybase error: Datastream processing out of sync.
> Sybase error: DBPROCESS is dead or not enabled.
I suspect that you are calling dbcancel() at the wrong time (ie while
a query is being processed). Please read the man page on
dbsetinterupt() in the Sybase DBlibrary/C docs to see what I mean.
Michael Peppler -||- Data Migrations Inc.
email@example.com -||- http://www.mbay.net/~mpeppler
Int. Sybase User Group -||- http://www.isug.com