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: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: Unexpected connects and disconnects at the DB server.
Date: Oct 8 2008 5:15AM

On Oct 7, 2008, at 10:28 PM, CSane@EvergreenInvestments.com wrote:

>
> Guys,
>
> Solaris
> DBD Sybase 1.05
>
> My co-workers code has a single dbh->connect.
> (he has a log/timestamp showing where he only calling it once.)
>
> The sybase sysaudits show repeated login/select/logouts.
> The perl code is believed to simply run multiple prepare/executes.
>
> The logouts are occurring 6 millisecs after the select statement yet  
> his code does not have any explicit disconnect logic.
>
> Any ideas?
>

Yes :-)

What happens is that DBD::Sybase is opening a second connection "under  
the covers" because the query on the primary connection is still  
considered "active" when another query is initiated.

You can easily see this if you run DBD::Sybase with DBI->trace(5).

In DBD::Sybase 1.08 you can set a database connection attribute that  
prohibits opening secondary connections in this way. In addition newer  
versions of DBD::Sybase are better at clearing results from a query.

Michael
--
Michael Peppler              -                    Peppler Consulting  
SaRL
mpeppler@peppler.org         -                     http://www.peppler.org
Sybase DBA/Developer         -      TeamSybase: http://www.teamsybase.com
Sybase on Linux FAQ          -      http://www.peppler.org/FAQ/linux.html