Re: Apache::Session::Store::Postgres FOR UPDATE problems

[prev] [thread] [next] [Date index for 2005/04/29]

From: Perrin Harkins
Subject: Re: Apache::Session::Store::Postgres FOR UPDATE problems
Date: 15:05 on 29 Apr 2005
Kjetil Kjernsmo wrote:
> On the surface, the symptom is that for certain pages, it will just sit 
> and spin at the $self->{materialize_sth}->execute; call in 
> Apache::Session::Store::Postgres for exactly two minutes, then time 
> out, and that makes the rest of the app confused, so most things go 
> boom... 

This probably means that in a previous request you never let the session 
object go out of scope so it kept the exclusive lock open.

> So, I'm guessing that what happens is that it sits and waits for a 
> UPDATE that never happens. I tried to remove the FOR UPDATE from the 
> SQL statement, and it solves the immediate problem. But FOR UPDATE is 
> something that is used for transactional integrity, and so, it is 
> probably a Good Thing and there is probably a good reason why it is 
> there...

It creates an exclusive lock on that row.  This may or may not be 
necessary, depending on how you use sessions in your application.

> I guess it could be that the use we make of Apache::Session is flawed, 
> that we should call an update somewhere

You just have to let the object get destroyed so it can release the lock.

- Perrin

Apache::Session::Store::Postgres FOR UPDATE problems
Kjetil Kjernsmo 14:50 on 29 Apr 2005

Re: Apache::Session::Store::Postgres FOR UPDATE problems
Perrin Harkins 15:05 on 29 Apr 2005

Generated at 10:25 on 04 May 2005 by mariachi v0.52