Skip Menu |

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

Report information
The Basics
Id: 1878
Status: open
Priority: 0/
Queue: Apache-Session

People
Owner: Nobody in particular
Requestors: marcus [...] semantico.com
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 1.54
Fixed in: (no value)



Subject: elimination of AutoCommit warning
Apache::Session 1.54 perl: 5.8.0 or 5.6.1 uname -a: Linux wasabi.rp.lan 2.4.7-10smp #1 SMP Thu Sep 6 17:09:31 EDT 2001 i686 unknown (but will affect all o/s) Apache::Session::Store::Postgres.pm assumes that the $dbh created has AutoCommit to Off and therefore blithely calls {$self->{dbh}->commit without checking for AutoCommit which triggers the warning: commit ineffective with AutoCommit enabled at /opt/projects/sitegroup/oxford/5.8.0/Apache/Session/Store/Postgres.pm line 93. patch supplied Marcus
--- Postgres.pm 2002-12-16 16:26:41.000000000 +0000 +++ Postgres.pm.modified 2002-12-16 16:33:02.000000000 +0000 @@ -89,7 +89,7 @@ sub DESTROY { my $self = shift; - if ($self->{commit}) { + if ($self->{commit} && ! $self->{dbh}->{AutoCommit}) { $self->{dbh}->commit; }
The Postgres storage module depends on transactional behavior. If a DBH is passed in with AutoCommit, the module will misbehave. Resolved: not accepting this patch.
[JBAKER - Mon Dec 16 12:39:03 2002]: Show quoted text
> The Postgres storage module depends on transactional behavior. If a DBH > is passed in with AutoCommit, the module will misbehave. > > Resolved: not accepting this patch.
In that case, I suggest that if a $dbh is supplied with AutoCommit to 1, that it gets explicitly set to 0 if the module will misbehave otherwise. Couldn't find this in the docs but maybe I missed it. Cheers, Marcus
In fact, the patch does apply! It is a system requirement to have AutoCommit set to 1 in our $dbh to avoid Postgres leaving processes 'idle in transaction' (very bad) So the dbh handle in our environment *must* be on. In Apache::Session::Postgres man page, it states the Commit option is required during the tie. (NB. it doesn't say it must be set to 1, but it must be present). If we set this to 0, we don't get AutoCommit behaviour, if we set it to 1, everything works perfectly except for the zillions of error lines in the error log. So, if you apply the patch, your module will function identically as before with the exception that it won't try to do a $dbh->commit if AutoCommit is on (which prompts the warnings). Until then we are having to override this method to bypass the problem (not nice) Best Regards, Marcus