You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Angus Lees <gu...@switchonline.com.au> on 2001/05/11 08:07:03 UTC

(patch) Apache::Session::Store::Postgres bugs

(Apache::Session 1.53 & HTML::Embperl 1.3.1)

I just started using Postgres with HTML::Embperl sessions, and ..
nothing worked.

HTML::Embperl keeps reusing the same session object, and just calls
$udat->save to write the data back.

Apache::Session::Store::Postgres, however does the INSERT, but doesn't
actually commit it until it is DESTROYed -- so nothing ever actually
gets written back to the database.  imho, this is the wrong behaviour
anyway.


i've changed insert(), update() and remove() to commit afterwards (if
successful).

ideally, i'd like to rollback on DESTROY (if something went wrong and
you couldn't call save(), the last thing you want is for it to be
autocommitted!).  unfortunately, this would seem to go against
standard Apache::Session usage, which doesn't require you to call
save() at all.  A good compromise would be to rollback if
Transaction=>1, else commit - and that is what is implemented here.

I don't see why these changes couldn't be moved into
Apache::Session::Store::DBI, since rollback/commit are no-ops where
they aren't implemented (eg: MySQL).


NB: i haven't updated any documentation to reflect this.

-- 
 - Gus