PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: David C Worenklein <dcw at gcm dot com>
Subject: Re: DBlib: telling if there are more rows pending, w/o blocking
Date: Jan 6 1999 5:58PM

Not so.

Open two isql sessions.  In the first:
>begin transaction
>go
>update very_large_table set column=value where clustered_index = last_row
>go

In the second:
>select * from very_large_table

Watch data go streaming through your second isql session, and then
watch it come to a screeching halt when it hits the page you locked
with your first session.

In the first session, rollback the transaction, and watch the second
one finish.

>>>>> "David" == David C Worenklein  writes:
    David> I'm calling dbresults, then a bunch of dbnextrow's, but I
    David> don't want to block.
    David>
    David> I use dbpoll to tell me if there's data waiting for me.
    David> The problem is, after I get the last row, dbpoll returns
    David> TIMEOUT, so I don't know if I'm done with this result set,
    David> or if I'm just waiting for Sybase to come back.
    David>
    David> Is there a DB_ARE_THERE_MORE_ROWS_IN_THIS_RESULT_SET call?
>>>>> "Michael" == Michael Peppler  writes:
    Michael>  I'm not sure that I understand the problem.
    Michael> 
    Michael> Given this:
    Michael> 
    Michael> while($dbh->dbresults != NO_MORE_RESULTS) { while(@dat =
    Michael> $dbh->dbnextrow) { ....  } }
    Michael> 
    Michael> where are you afraid that your script will block?  In
    Michael> general - once you've started to retrieve rows you won't
    Michael> block in the dbnextrow() call.  You may block in the
    Michael> dbresults() call, I guess, but you can check
    Michael> $dbh->DBMORECMDS to see if there are more result sets to
    Michael> be processed...
    Michael> 
    Michael> Or am I completely missing the problem here?
    Michael> 
    Michael> Michael -- Michael Peppler -||- Data Migrations Inc.
    Michael> mpeppler@mbay.net -||- http://www.mbay.net/~mpeppler
    Michael> Int. Sybase User Group -||- http://www.isug.com Sybase on
    Michael> Linux mailing list: ase-linux-list@isug.com
    Michael>