Re: Deadlock problem

From: "Vit Timchishin" <tivv(at)gtech-ua(dot)com>
To: "Kris Jurka" <books(at)ejurka(dot)com>
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Deadlock problem
Date: 2005-11-22 11:53:44
Message-ID: 200511221353.000000EK@dev-null
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Benjamin Stookey 2005-11-22 19:23:22 Re: Deploying my application (nesting the jar)
Previous Message Oliver Jowett 2005-11-22 09:33:20 Re: Can PostgreSQL do data type automated casting in