X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id C88559FA2DB for ; Wed, 24 May 2006 08:31:47 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 62059-01 for ; Wed, 24 May 2006 08:31:37 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by postgresql.org (Postfix) with SMTP id 8777C9FA2FA for ; Wed, 24 May 2006 08:31:37 -0300 (ADT) Received: (qmail 32156 invoked from network); 24 May 2006 11:31:36 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 24 May 2006 11:31:36 -0000 In-Reply-To: <4473EB35.3080706@katamail.com> References: <4473EB35.3080706@katamail.com> Mime-Version: 1.0 (Apple Message framework v750) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <5F5C13EA-2C78-49F3-83B3-AAF5393B0DFD@fastcrypt.com> Cc: pgsql-jdbc@postgresql.org Content-Transfer-Encoding: 7bit From: Dave Cramer Subject: Re: R: Help lock record Date: Wed, 24 May 2006 07:31:35 -0400 To: bitrunner X-Mailer: Apple Mail (2.750) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/120 X-Sequence-Number: 15248 On 24-May-06, at 1:12 AM, bitrunner wrote: > > On 23-May-06, at 1:37 PM, bitrunner wrote: > > > For lock the record I use: > > select * from orders where id = 17 for update > > > > in this way lock the record with id = 17. > > If an other user demands the same record as I can understand that > it is lock? > > > yes as long as autocommit is false this is true. In other words as > > long as you do this inside a transaction/ > > > sorry but I dont have to understand. > How I can understand that there is an other user who lock the record? I think I understand the question. You want to know how to determine if the record is locked. As far as I know there isn't a way. If process A locks the record, then process B attempts to lock the record it will block until process A releases the record. If you have statement_timeout set to some value other than -1 then process B will timeout after waiting for the statement_timeout. Otherwise it will block until process A is finished with the record. Dave > > Thanks. > > ---------------------------(end of > broadcast)--------------------------- > TIP 3: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faq >