Skip Menu |

This queue is for tickets about the Apache-Session CPAN distribution.

Report information
The Basics
Id: 32148
Status: resolved
Priority: 0/
Queue: Apache-Session

Owner: Nobody in particular
Requestors: TONYC [...]

Bug Information
Severity: Normal
Broken in: 1.85
Fixed in: (no value)

Subject: ...::Lock::MySQL statement handles warning
Download (untitled) / with headers
text/plain 662b
Using Apache::Session::MySQL with DBI 1.601 causes the warning: DBI::db=HASH(0x833c3d0)->disconnect invalidates 2 active statement handles (either destroy statement handles or call finish on them before disconnecting) at line 22. when you disconnect the DBH - after the session has gone out of context. This only happens if DBI's PrintWarn option is enabled (which is enabled by $^W.) I've attached that demonstrates the problem. Adding calls to finish() to acquire_read_lock() and release_read_lock() in Apache::Session::Lock::MySQL prevents the warning. I've attached apache_session_finish.diff which fixes the problem
Subject: apache_session_finish.diff
diff -ur -x blib -x /home/tony Apache-Session-1.85-orig/Session/Lock/ Apache-Session-1.85/Session/Lock/ --- Apache-Session-1.85-orig/Session/Lock/ 2007-09-29 04:36:57.000000000 +1000 +++ Apache-Session-1.85/Session/Lock/ 2008-01-08 11:33:49.000000000 +1100 @@ -52,6 +52,7 @@ my $sth = $self->{dbh}->prepare_cached(q{SELECT GET_LOCK(?, 3600)}, {}, 1); $sth->execute($self->{lockid}); + $sth->finish(); $self->{lock} = 1; } @@ -68,6 +69,7 @@ my $sth = $self->{dbh}->prepare_cached(q{SELECT RELEASE_LOCK(?)}, {}, 1); $sth->execute($self->{lockid}); + $sth->finish(); $self->{lock} = 0; } Only in Apache-Session-1.85/Session/Lock:
text/x-perl 409b
#!perl -w use strict; use DBI; #use blib '/home/tony/src/Apache-Session-1.85-orig'; #use blib '/home/tony/src/Apache-Session-1.85'; use Apache::Session::MySQL; my $dbh = DBI->connect('dbi:mysql:bsetest', 'bsetest', 'bsetest') or die; { my %session; my $id; tie %session, 'Apache::Session::MySQL', $id, { Handle => $dbh, LockHandle => $dbh }; untie %session; } $dbh->disconnect;
Download (untitled) / with headers
text/plain 168b
Jan 07 19:49:55 2008, TONYC wrote: Show quoted text
> Using Apache::Session::MySQL with DBI 1.601 causes the warning:
Fixed in future 1.85_01. -- Alexandr Ciornii,

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to