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: Chuck Griffith <griffch at startribune dot com>
Subject: shared locks and connections
Date: Feb 27 1998 10:08PM

We are having a lot of problem with deadlocks. It seems to be involved
with several programs that simply do selects and hence would only have
shared locks. The program runs like this:


startup
Sybase::CTlib->ct_connect(...)
$dbh->ct_execute( select ... from ... noholdlock...)
while (($status = $dbh->ct_results($resultType)) == CS_SUCCEED) {
  next unless ($dbh->ct_fetchable($resultType));
  unless (defined($hash) and $hash == 0) {
    my (%dat);
    while ((%dat = $dbh->ct_fetch(1))) {
      push @$list, { %dat };
    }
  }
}
build html
end program


1. using noholdlock does not seem to be helping and we have a call into
   Sybase as to why.
2. is it possible that even after retrieving the last row that the locks
   are still being held? It seems to be true that if 'build html' takes
   too long, the deadlocks increase. I suppose this could be that this
   step is holding up other programs while they are retrieving rows and
   those programs would be involved with deadlocks.
3. would closing the connection after the last sql is finished help the
   problem?

------------------------------------------------------------------------
Chuck Griffith
612-673-4105