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:
> 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?
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 Peppler - Peppler Consulting
email@example.com - http://www.peppler.org
Sybase DBA/Developer - TeamSybase: http://www.teamsybase.com
Sybase on Linux FAQ - http://www.peppler.org/FAQ/linux.html