Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: sy50027 at milton dot sbi dot com (Simon Yaminian)
Subject: Re: out of sync message
Date: Jun 4 1998 4:23PM

> From Thu Jun  4 11:37:31 1998
> From: Michael Peppler 
> Mime-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Date: Thu,  4 Jun 1998 08:33:07 -0700 (PDT)
> To: SybPerl Discussion List 
> Subject: out of sync message
> X-Listprocessor-Version: 8.2.06 -- ListProc(tm) by CREN
> Simon Yaminian writes:
>  > Hello,
>  > 
>  > 	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
>  > call.
>  > 
>  > 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
> -- 
> Michael Peppler         -||-  Data Migrations Inc.
>    -||-
> Int. Sybase User Group  -||-
Thank You for your response.

Is there any similar functionality in Sybperl that one can use? i.e. to cancel 
the query while it is being processed.

Simon Yaminian