<?xml version="1.0" encoding="windows-1252"?>
<node id="33425" title="Confirm persistent db connection?" created="2000-09-20 23:01:08" updated="2005-08-10 08:33:18">
<type id="1857">
categorized question</type>
<author id="11732">
QandAEditors</author>
<data>
<field name="doctext">
I have a web resource served by Apache with a Perl interface
to a MySQL database.  In order to speed things up, I am using 
mod_perl/Apache::DBI to create a persistent database connection 
in a script that is run when Apache is started.&lt;br&gt;
&lt;br&gt;
I want to make sure that I actually have a persistent connection. 
The scripts that query the db were not originally written 
with mod_perl in mind and each one contains a db connection
statement. The mod_perl guide says these will be ignored
if a persistent connection exists.&lt;br&gt;
&lt;br&gt;
The obvious way to test would be to remove these statements 
and see if the queries fail but I'm sure there must be a 
more elegant and explicit test.&lt;br&gt;
&lt;br&gt;
Does anyone know how to do this? Is there a connection id or
environment variable that I can get?&lt;br&gt;
&lt;br&gt;
Specs:
&lt;ul&gt;
	&lt;li&gt;MySQL 3.22.21&lt;/li&gt;
	&lt;li&gt;Apache 1.3.9&lt;/li&gt;
	&lt;li&gt;Perl 5.004_04&lt;/li&gt;
	&lt;li&gt;Apache::DBI 0.87&lt;/li&gt;
	&lt;li&gt;DBI 1.14&lt;/li&gt;
&lt;/ul&gt;
&lt;br&gt;
Thanks in advance...&lt;br&gt;
&lt;br&gt;
&lt;i&gt;&amp;#91;formatted by editor&amp;#93;&lt;/i&gt;</field>
<field name="parent_node">
1831</field>
</data>
</node>
