pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: bitrunner <bitrunner@katamail.com>
To: pgsql-jdbc@postgresql.org
Subject: re_ help lock record
Date: Wed, 24 May 2006 14:28:35 +0200
Message-ID: <44745173.3080809@katamail.com> (raw)

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.




view thread (2+ messages)  latest in thread

Message-ID: <44745173.3080809@katamail.com>
Permalink:  ../44745173.3080809@katamail.com/
Also on:    postgresql.org/message-id/44745173.3080809@katamail.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: bitrunner@katamail.com
  Subject: Re: re_ help lock record
  In-Reply-To: <44745173.3080809@katamail.com>
  References: <44745173.3080809@katamail.com>

* 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