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

RE: [INTERFACES] Transaction support in 6.5.3/JDBC

From: Peter Mount <petermount(at)it(dot)maidstone(dot)gov(dot)uk>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Assaf Arkin <arkin(at)exoffice(dot)com>
Cc: Peter Mount <petermount(at)it(dot)maidstone(dot)gov(dot)uk>, pgsql-interfaces(at)hub(dot)org
Subject: RE: [INTERFACES] Transaction support in 6.5.3/JDBC
Date: 1999-12-09 07:39:27
Message-ID: (view raw or whole thread)
Lists: pgsql-interfaces
JDBC should break out of the deadlock in the same way as psql. I'll run
some tests, as it might be that the protected method ExecSQL() is
waiting for a normal response, and is ignoring the notify. That's the
only place I can think it is hanging.


Peter Mount
Enterprise Support
Maidstone Borough Council
Any views stated are my own, and not those of Maidstone Borough Council.

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Thursday, December 09, 1999 1:01 AM
To: Assaf Arkin
Cc: Peter Mount; pgsql-interfaces(at)hub(dot)org
Subject: Re: [INTERFACES] Transaction support in 6.5.3/JDBC 

Assaf Arkin <arkin(at)exoffice(dot)com> writes:
> I have a very simple test. I start two threads, both of them attempt
> do an update on the exact same row in the table, both connections keep
> hanging.

Hmm.  The backend doesn't have any trouble detecting this; I checked
both current sources and 6.5.3:

play=> select * from z1;
(2 rows)

play=> begin;
play=> update z1 set f1 = 3 where f1 = 1;

<now in a second psql do>

play=> begin;
play=> update z1 set f1 = 4 where f1 = 2;
play=> update z1 set f1 = 3 where f1 = 1;

<second psql is now waiting for first one to commit or abort>

<back in first psql do>

play=> update z1 set f1 = 4 where f1 = 2;

After a second or so, one psql will say
NOTICE:  Deadlock detected -- See the lock(l) manual page for a possible
ERROR:  WaitOnLock: error on wakeup - Aborting this transaction
and the other will say

If you're not getting this behavior, then either your test code is wrong
or there's something broken in the JDBC driver...

			regards, tom lane

pgsql-interfaces by date

Next:From: martenDate: 1999-12-09 08:00:09
Subject: Re: [INTERFACES] locking on database updates
Previous:From: Peter MountDate: 1999-12-09 07:28:11
Subject: RE: [INTERFACES] Transaction support in 6.5.3/JDBC

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