The idea of Apache::DBI is that you get to pool connections.

If you call Apache::DBI->new and there is a spare connection, you get it, if 
not, one is created for you.

You almost certainly don't want one $db object being shared as a member of a 
class, unless your entire program also happens to represent one DB transaction.





Josh Narins
Director of Application Development
SeniorBridge

845 Third Ave
7th Floor
New York, NY 10022
Tel: (212) 994-6194
Fax: (212) 994-4260
Mobile: (917) 488-6248
jnar...@seniorbridge.com
seniorbridge.com<http://www.seniorbridge.com/>

[http://www.seniorbridge.com/images/seniorbridgedisclaimerTAG.gif]


________________________________
SeniorBridge Statement of Confidentiality: The contents of this email message 
are intended for the exclusive use of the addressee(s) and may contain 
confidential or privileged information. Any dissemination, distribution or 
copying of this email by an unintended or mistaken recipient is strictly 
prohibited. In said event, kindly reply to the sender and destroy all entries 
of this message and any attachments from your system. Thank you.
From: mike cardeiro [mailto:mcarde...@yahoo.com]
Sent: Wednesday, January 18, 2012 5:08 PM
To: modper
Subject: preloading modules and apache::dbi

Hi,

I am totally new to mod perl (after 13+ years of building web applications on 
shared servers I now am developing on a dedicated box woo-hoo)

I have installed apache::dbi and set it to preload in the apache config file.  
Here is what I think my problem might be.

I have a library I want to preload.  This library makes a database connection 
and assigns it to a variable that is exported so all programs can use this 
handle.

will this global handle db handle be a single handle amongst all apache 
processes, or will each process load this library on its own thus having a 
unique db handle for each httpd process?

sorry if this is incoherent.

Mike Cardeiro

Reply via email to