Re: Deadlock problem - Mailing list pgsql-jdbc

From Vit Timchishin
Subject Re: Deadlock problem
Date
Msg-id 200511221353.000000EK@dev-null
Whole thread Raw
In response to Re: Deadlock problem  (Kris Jurka <books@ejurka.com>)
List pgsql-jdbc
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




pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: Can PostgreSQL do data type automated casting in
Next
From: Benjamin Stookey
Date:
Subject: Re: Deploying my application (nesting the jar)