Lev Lvovsky wrote:

On Nov 28, 2006, at 11:03 PM, Philip M. Gollucci wrote:

is this mod_perl 1 or 2 ?
Setting $Apache::DBI::Debug = 2; and watching you're error log file
should tell you what its doing.

package X;
# database
our $host = 'mysql.x.y';
our $dsn  = "dbi:mysql:db;host=$host";
our $user = 'u';
our $pass = 'p';
our %db_attrs = (

Thanks Philip - it turns out that our problem was the order that we were doing things in. First the 'use' statements were not in the correct order, and we were only connecting to the DB once in the very beginning of the mod_perl handler (before the handler() sub itself). Looking through the Apache::DBI code, it's now a bit more clear what the usage is - since the ping functionality is built-in to connect(), whenever the handler is hit now, we call the connect() then, and let Apache::DBI take care of everything else - works like a charm.

Now we might add more error handling around the begin_work section in case the DB connection drops immediately after the connect() is called but before the begin_work is called.
If you can suggest a documentation patch you feel clarify things, I'll read it over and commit for version 1.06 (sorry about that 1.05 is current)


--
------------------------------------------------------------------------
Philip M. Gollucci ([EMAIL PROTECTED]) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

I never had a dream come true
'Til the day that I found you.
Even though I pretend that I've moved on
You'll always be my baby.
I never found the words to say
You're the one I think about each day
And I know no matter where life takes me to
A part of me will always be...
A part of me will always be with you.

Reply via email to