X-Original-To: pgsql-sql@postgresql.org Received: from jester.inquent.com (CPE00508b028d7d-CM00803785c5e0.cpe.net.cable.rogers.com [24.103.51.175]) by postgresql.org (Postfix) with ESMTP id 11D35474E42 for ; Sun, 9 Mar 2003 10:34:58 -0500 (EST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by jester.inquent.com (8.12.6/8.12.6) with ESMTP id h29FZd2L094979; Sun, 9 Mar 2003 10:35:41 -0500 (EST) (envelope-from rbt@rbt.ca) Subject: Re: check if table/object is locked From: Rod Taylor To: Jonathan Weiss Cc: pgsql-sql@postgresql.org In-Reply-To: <28935.1047222888@www1.gmx.net> References: <28935.1047222888@www1.gmx.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-4MXPx2kKXV9Z6E0Q04tL" Organization: Message-Id: <1047224138.28251.210.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 09 Mar 2003 10:35:39 -0500 X-Archive-Number: 200303/223 X-Sequence-Number: 12263 --=-4MXPx2kKXV9Z6E0Q04tL Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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! >=20 >=20 > 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 lock= ed > before i want to load him? >=20 > thanks, >=20 >=20 > Jonathan Weiss --=20 Rod Taylor PGP Key: http://www.rbt.ca/rbtpub.asc --=-4MXPx2kKXV9Z6E0Q04tL Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQA+a19K6DETLow6vwwRAhYuAJ9/fcHK6Xa4Kd1iyV10EA9Pku4glgCaA8jS DNawJQY3yboISr/OQ7jOoOw= =zfUh -----END PGP SIGNATURE----- --=-4MXPx2kKXV9Z6E0Q04tL--