pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rod Taylor <rbt@rbt.ca>
To: Jonathan Weiss <infojowe@gmx.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: check if table/object is locked
Date: 09 Mar 2003 10:35:39 -0500
Message-ID: <1047224138.28251.210.camel@jester> (raw)
In-Reply-To: <28935.1047222888@www1.gmx.net>
References: <28935.1047222888@www1.gmx.net>

Simple answer is don't lock it like that.

Store a 'last changed' date that you update when you change the tuple.
Confirm prior to writing that the 'last change' date hasn't changed
since you pulled out the information to display to the user (yes, do the
for update lock during this much shorter time).

On Sun, 2003-03-09 at 10:14, Jonathan Weiss wrote:
> hi!
> 
> 
> i have a problem. i developed an application for administrating cliet and
> their sales. if i want to edit a client i load him by select for update. now if
> another person want to update him, the query waits, until the first
> connection is closed. this is unacceptable, because the whole application is doing
> nothing until the db is responding. how can i check if the client is locked
> before i want to load him?
> 
> thanks,
> 
> 
> Jonathan Weiss
-- 
Rod Taylor <rbt@rbt.ca>

PGP Key: http://www.rbt.ca/rbtpub.asc

Attachments:

  signature.asc (application/pgp-signature, 186B) download

view thread (2+ messages)

Message-ID: <1047224138.28251.210.camel@jester>
Permalink:  ../1047224138.28251.210.camel@jester/
Also on:    postgresql.org/message-id/1047224138.28251.210.camel@jester

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rbt@rbt.ca, infojowe@gmx.de
  Subject: Re: check if table/object is locked
  In-Reply-To: <1047224138.28251.210.camel@jester>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox