It needs DBI 1.44 or above, and Sys::SigAction.
It hasn't yet been fully indexed and propagated on CPAN, but you can get it from:
http://www.cpan.org/modules/by-authors/id/H/HA/HASSEILY/DBIx-HA -0.91.tar.gz
From the README:
DBIx::HA is a High Availability module for DBI. It is implemented by overloading the DBI connect, prepare and execute methods and can be seamlessly used without code modification except for initialization.
DBIx::HA also works seamlessly with Apache::DBI when available, and
ensures that cached database handles in the Apache::DBI module are properly
released when failing over.
Features of DBIx::HA are:
- multiple failovers
Should a datasource become unavailable, queries are automatically sent to
the next available datasource in a user-configured datasource stack.
All subsequent queries continue to hit the failover server until
reinitialized. This ensures that a failed datasource can be properly brought
back online before it is put back in service.
- timeouts
Database calls are wrapped in user-configurable timeouts. Connect and execute
timeouts are handled independently.
- configurable retries Queries can be retried n times before a datasource is considered failed.
- callback function
A user-defined callback function can be called upon abnormal failure and
disconnection from a datasource in order to perform housekeeping tasks for
the user's application.
- inter-process automatic failover under mod_perl
Failover can be triggered for a single process or a set of processes at the
application level. Specifically designed for Apache's multi-process model,
if one mod_perl process triggers a failover, it is propagated to all other
mod_perl processes using the same database handle.
DBIx::HA was designed primarily for reliability and speed. Functionality that would compromise speed was not considered.
This latest revision has not yet been fully production-tested. Use at your own risk!
On Oct 18, 2004, at 2:15 PM, BAXTER, LINCOLN A wrote:
OH... Coooool!
-----Original Message----- From: Henri Asseily [mailto:[EMAIL PROTECTED] Sent: Monday, October 18, 2004 5:12 PM To: '[EMAIL PROTECTED]'; Jesse, Rich Subject: Re: Slow connection to Oracle 9i
I have a DBIx::HA (High Availability) module on CPAN, but I'm readying a next version real soon now that will take care of this for you. If you combine Apache+mod_perl+Apache::DBI+DBIx::HA, you'll get what you need. I'm debugging one last instance of a dbh having an ActiveKid handle when it shouldn't, and then I'll release it. It will require DBI 1.44+ (needs swap_inner_handle()).
On Oct 18, 2004, at 2:05 PM, Jesse, Rich wrote:
Hmmmm...one thing I thought of is to check the validity of the handle, in case the Oracle instance bounces (i.e. The Oracle instance is available, but the persistent connection no longer exists). Does that automagically happen in the connect or should there be code to check for a specific error either on the connect or maybe the statement handle?
Rich
Rich Jesse System/Database Administrator [EMAIL PROTECTED] QuadTech, Sussex, WI USA
-----Original Message----- From: Jesse, Rich [mailto:[EMAIL PROTECTED] Sent: Monday, October 18, 2004 3:51 PM To: Paul Appleby; BAXTER, LINCOLN A Cc: [EMAIL PROTECTED] Subject: RE: Slow connection to Oracle 9i
Perhaps this'll help:
http://perl.apache.org/docs/1.0/guide/ performance.html#Persistent_DB_Connections
There's a link on that site to "Tim Bunce's Advanced DBI talk", but it returns a 500. Tim???
Rich
Rich Jesse System/Database Administrator [EMAIL PROTECTED] QuadTech, Sussex, WI USA
-----Original Message----- From: Paul Appleby [mailto:[EMAIL PROTECTED] Sent: Monday, October 18, 2004 3:39 PM To: BAXTER, LINCOLN A Cc: [EMAIL PROTECTED] Subject: RE: Slow connection to Oracle 9i
My CGI application will be called by different users at different times. Are you saying the first user's connection can be left open for all the other users? How?
Paul
