You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Dan McCormick <da...@yahoo.com> on 2001/03/08 18:24:37 UTC

row locking problems with AutoCommit, Apache::Session, and Oracle

Hi,

I've been experiencing row locking problems using
Oracle 8.1.6 and Apache::Session with AutoCommit on. 
It seems that when AutoCommit is on, doing a "select
for update" locks the row until you execute a
subsequent update command or issue an explicit commit
statement.  (You can replicate this using sqlplus in
two terminal windows.)

The problem with this is that the materialize method
in Apache::Session::Store::Oracle issues a "select for
update" command during the TIEHASH call, even if no
subsequent update ever occurs.  So if you're just
reading from the session object, the row gets locked
but never unlocked, and subsequent session calls hang.

A quick fix is to always issue the
$self->{dbh}->commit call in the DESTROY method of
Apache::Session::Store::Oracle, regardless of whether
or not $self->{commit} is set to 0 or 1.  This will
generate a warning when AutoCommit is on, but seems to
solve the problem.

Dan

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/