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 3AFC89FA2DB for ; Wed, 24 May 2006 09:29:09 -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 68797-03 for ; Wed, 24 May 2006 09:29:01 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from swip.net (mailfe05.tele2.it [212.247.154.141]) by postgresql.org (Postfix) with ESMTP id 407FA9F9F8F for ; Wed, 24 May 2006 09:29:00 -0300 (ADT) X-T2-Posting-ID: GgxMXzuLwkbCxPcVROCFQQ== X-Cloudmark-Score: 0.000000 [] Received: from [83.184.182.136] (HELO [192.168.1.33]) by mailfe05.swip.net (CommuniGate Pro SMTP 5.0.8) with ESMTP id 101245722 for pgsql-jdbc@postgresql.org; Wed, 24 May 2006 14:28:58 +0200 Message-ID: <44745173.3080809@katamail.com> Date: Wed, 24 May 2006 14:28:35 +0200 From: bitrunner User-Agent: Mozilla Thunderbird 1.5.0.2 (Windows/20060308) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: re_ help lock record Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/121 X-Sequence-Number: 15249 Dave wrote: 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. ------------------------------------------------------------------------ yes is my problem, you have understood perfectly!!! I have already used the statement_timeout but it does not work: it does not raise exception. This is my code: conPostgre.transactionStart(); Statement stm = conPostgre.connection.createStatement(); stm.setQueryTimeout(3); rs = stm.executeQuery("select * from prova where \"prvID\" = 1 for update"); System.out.println("Lock: " + rs.next()); I must set up of the parameters to postgresql.conf? Thanks a lot.