Spencer Christensen wrote:

>Quoting Joel Gwynn <[EMAIL PROTECTED]>:
>
>>While looking through my server logs for the reason behind sporadic 
>>failures of my script, I found this line:
>>
>>Issuing rollback() for database handle being DESTROY'd without explicit 
>>disconnect()
>>
>>In my 'teardown' method, I'm disconnecting like so:
>>
>>sub teardown {
>>    my $self = shift;
>>    $self->param('dbh')->disconnect();
>>}
>>
>>So I'm not sure why I'm getting that error message.  The message occurs 
>>even the script works properly.
>>
>>BTW, the other error, which seems to occur once in 20 times is:
>>
>>Premature end of script headers:
>>
>>Any ideas why this is happening?  Any ideas how I can get more 
>>information about this?
>>
>
>Hello Joel,
>  I would suggest adding a line in your app to log your database transactions.  
>This will help to debug where the breakdown of your database handle is 
>occuring.  You can do this with the DBI class method trace(), like this:
>
>package MyApp;
>use strict;
>use base 'CGI::Application';
>use DBI;
>DBI->trace(1,"/tmp/my_database_debugging.log");
>
>
>See http://www.perldoc.com/perl5.6.1/lib/DBI.html#DBI-Class-Methods under trace
>() for more info.
>
>
>-spencer christensen
>[EMAIL PROTECTED]
>
>---------------------------------------------------------------------
>Web Archive:  http://www.mail-archive.com/[email protected]/
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
Thanks for the suggestion.  I did this, and of course, I have no idea 
how to read the log.  Running with no arguments, with a trace level of 
3, and no queries, I get this:

 DBI 1.14-nothread dispatch trace level set to 3
    -> disconnect for DBD::mysql::db (DBI::db=HASH(0x85bff24)~0x85c86e8)
imp_dbh->svsock: 85d4204
    <- disconnect= 1 at bostonsweeper.pm line 42.
    <> DESTROY ignored for outer handle DBI::db=HASH(0x85bff24) (inner 
DBI::db=HASH(0x85c86e8))
    -> DESTROY for DBD::mysql::db (DBI::db=HASH(0x85c86e8)~INNER)
    <- DESTROY= undef at unknown location!
    -- DBI::END
    -> disconnect_all for DBD::mysql::dr (DBI::dr=HASH(0x82aae1c)~0x85c8610)
    <- disconnect_all= '' at DBI.pm line 450.
    -> DESTROY in DBD::_::common for DBD::mysql::dr 
(DBI::dr=HASH(0x85c8610)~INNER)
    <- DESTROY= undef during global destruction.
    <> DESTROY for DBI::dr=HASH(0x82aae1c) ignored (inner handle gone)

Now, line 42, referred to above, is where I have

$self->param('dbh')->disconnect();

$self->param('dbh') is being set in the setup subroutine.  What gives.

TIA







---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to