jnarins at seniorbridge
Jan 19, 2012, 5:48 AM
Post #4 of 7
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.
Director of Application Development
845 Third Ave
New York, NY 10022
Tel: (212) 994-6194
Fax: (212) 994-4260
Mobile: (917) 488-6248
jnarins [at] seniorbridge
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:mcardeiro [at] yahoo]
Sent: Wednesday, January 18, 2012 5:08 PM
Subject: preloading modules and apache::dbi
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.