Re: Apache::Session::Store::Postgres FOR UPDATE problems [OT]
[prev]
[thread]
[next]
[Date index for 2005/05/03]
On tirsdag 03 mai 2005, 00:40, Michael Schout wrote:
> Jeffrey W. Baker wrote:
> > It is possible that the FOR UPDATE is spurious. =A0It signals to the
> > database system that this transaction intends to write that row.
> > =A0With PostgreSQL's MVCC transaction isolation system, it's probably
> > not necessary and may be causing problems.
>
> It definately *is* necessary if you want to ensure that only one
> process has access to your session data at a time. =A0MVCC will prevent
> a second client from WRITING to the same row, but it will not block
> it from reading the row.
Thank you all for the follow-up!=20
Indeed the problem here is that we're not destroying the object=20
properly. It is the classical untie trap that we're in, described in=20
the Camel Book. However, neither of us has sufficient understanding of=20
the code, and of tied hashes, I suppose, to really track down the=20
issue. There really isn't any $foo =3D \%session in there, but we're=20
calling the handler from the invalidate method, which is most likely=20
the source of the problem.=20
It sort of works, with a few quirks, with DB_File as backend store, but=20
unsurprisingly, it doesn't with Pg. So, for now, I have filed a bug=20
against my own package, so that at least my users will have a fair=20
chance to understand what's going on:=20
http://rt.cpan.org/NoAuth/Bug.html?id=3D12473
If anyone wants to have a look, it is certainly appreciated, otherwise,=20
we'll just have to return to it $later.=20
Cheers,
Kjetil
=2D-=20
Kjetil Kjernsmo
Programmer/Astrophysicist/Skeptic/Ski-orienteer/Orienteer/Mountaineer
kjetil@xxxxxxxx.xxx webmaster@xxxxxxx.xx editor@xxxxxxxxxxxxxxxxxx.xxx
Homepage: http://www.kjetil.kjernsmo.net/ OpenPGP KeyID: 6A6A0BBC