pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
check if table/object is locked
2+ messages / 2 participants
[nested] [flat]

* check if table/object is locked
@ 2003-03-09 15:14  Jonathan Weiss <infojowe@gmx.de>
  0 siblings, 1 reply; 2+ messages in thread

From: Jonathan Weiss @ 2003-03-09 15:14 UTC (permalink / raw)
  To: pgsql-sql

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

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: check if table/object is locked
@ 2003-03-09 15:35  Rod Taylor <rbt@rbt.ca>
  parent: Jonathan Weiss <infojowe@gmx.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Rod Taylor @ 2003-03-09 15:35 UTC (permalink / raw)
  To: Jonathan Weiss <infojowe@gmx.de>; +Cc: pgsql-sql

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

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2003-03-09 15:35 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-03-09 15:14 check if table/object is locked Jonathan Weiss <infojowe@gmx.de>
2003-03-09 15:35 ` Rod Taylor <rbt@rbt.ca>

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