Skip site navigation (1) Skip section navigation (2)

Re: java is locked when select for update

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Mican Bican <mican58(at)gmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: java is locked when select for update
Date: 2005-03-09 16:28:45
Message-ID: 422F243D.4060804@fastcrypt.com (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-jdbc
Mican,

You can use the statement timeout GUC parameter to time out the second 
one. However in general holding a lock in a gui
is a bad idea if you are holding it for any length of time.  You may 
want to re-think your locking strategy.

Dave

Mican Bican wrote:

>Hello,
>
>I use Postgresql 8.0.1 with java 5 and jdbc3 on windows xp.
>
>When I do a "select for update" a row.. and dont commit the statement
>and when in this time an other user do also this. my java gui wait and
>locked till the first user commit his statement.. my question is how
>can I realize this with java.. for example why they are not a
>SQLException or are Error like "an other user is updating this row"...
>or can I say to java "dont wait" or "dont lock" when you make a select
>for update and an other user before you make this..
>
>thank you..
>
>best regards
>
>Mican Bican
>
>---------------------------(end of broadcast)---------------------------
>TIP 9: the planner will ignore your desire to choose an index scan if your
>      joining column's datatypes do not match
>
>
>  
>

-- 
Dave Cramer
http://www.postgresintl.com
519 939 0336
ICQ#14675561


In response to

pgsql-jdbc by date

Next:From: Csaba NagyDate: 2005-03-09 16:44:32
Subject: Re: [JDBC] java is locked when select for update
Previous:From: Csaba NagyDate: 2005-03-09 16:12:40
Subject: Re: java is locked when select for update

pgsql-general by date

Next:From: FERREIRA William (COFRAMI)Date: 2005-03-09 16:31:01
Subject: partitionning
Previous:From: GeoffreyDate: 2005-03-09 16:28:05
Subject: Re: PostgreSQL still for Linux only?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group