pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vit Timchishin <tivv@gtech-ua.com>
To: Kris Jurka <books@ejurka.com>
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: Deadlock problem
Date: Tue, 22 Nov 2005 13:53:44 +0200 (EET)
Message-ID: <200511221353.000000EK@dev-null> (raw)
In-Reply-To: <Pine.BSO.4.61.0511211801550.23994@leary.csoft.net>

On Mon, 21 Nov 2005 18:06:37 -0500 (EST), Kris Jurka wrote:

>
>
>On Mon, 21 Nov 2005, Vit Timchishin wrote:
>
>> I am not using one connection and at the time of block there is only one 
>> active query (that is locked) at the whole database (in my test case). 
>> But for one transaction it may be used by different java threads (e.g. 
>> main thread and finalizer) and it seems that this is producing problems 
>> because exclusive lock is held after statement have finished. It is 
>> possible that I am still having open resultsets (did not check), but 
>> they are all forward only and not updateable.
>>
>
>Locks are always held until transaction commit, not the end of an 
>individual statement.  So, while you may only have one statement executing 
>you have more than one transaction in progress and this is causing your 
>deadlocks.  

This is not the problem. I know good about locks, but this one:
 relation | database | transaction |  pid  |      mode       | granted
----------+----------+-------------+-------+-----------------+---------
          |          |     1109601 | 32172 | ExclusiveLock   | t

1) Not related to any relation. Relation and database fields are null
2) Intertransaction - transaction field of lock that is granted (example above) and that is trying to lock are 
equal. The only difference is the pid column (and that the lock that is trying is SharedLock and granted = f).


С уважением,
Виталий Валериевич Тимчишин,
Технический Директор
ООО "Голден Технолоджис"
http://www.gtech-ua.com






view thread (9+ messages)

Message-ID: <200511221353.000000EK@dev-null>
Permalink:  ../200511221353.000000EK@dev-null/
Also on:    postgresql.org/message-id/200511221353.000000EK@dev-null

 · 

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: tivv@gtech-ua.com, books@ejurka.com
  Subject: Re: Deadlock problem
  In-Reply-To: <200511221353.000000EK@dev-null>
  References: <Pine.BSO.4.61.0511211801550.23994@leary.csoft.net> <200511221353.000000EK@dev-null>

* 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