perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Perrin Harkins" <phark...@gmail.com>
Subject Re: Apache2.2 - openssl 0.9.8d - modperl 2.03 unpredictable timeouts during requests
Date Mon, 05 Mar 2007 21:16:36 GMT
On 3/5/07, Jonathan Vanasco <jvanasco@2xlp.com> wrote:
> I recently had this code in my system
>
>         handle 1-       select * from account where id = 1;
>         handle 2-       update visit set visit_count= visit_count+1 where
> account_id = 1; # account_id fkeys on account
>
> it took me forever to realize why my system kept locking.  the select
> + transaction on handle 1 was getting an exclusive lock, and the
> update was queued , trying to do an internal select on the fkey for
> integrity checks

I'm no Postgres expert, but I don't think a SELECT should block an
UPDATE in an MVCC database system unless the first statement is a
SELECT FOR UPDATE or similar.  Maybe if you use an isolation level of
REPEATABLE READ.

- Perrin

Mime
View raw message