Re: executeUpdate() deadlock

From: "Waldomiro" <wmiro(at)ig(dot)com(dot)br>
To: Fischer Krisztián <fischer(at)borganization(dot)com>, "pgsql-jdbc" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: executeUpdate() deadlock
Date: 2004-01-26 12:39:43
Message-ID: 000901c3e409$7b227440$1001a8c0@shx.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

I've done this test on a psql program, so the second session waited up to
the first session be committed.

Postgres doesn't throw an exception because he manages the concurrency.

wmiro.

----- Original Message -----
From: "Fischer Krisztián" <fischer(at)borganization(dot)com>
To: "pgsql-jdbc" <pgsql-jdbc(at)postgresql(dot)org>
Sent: Monday, January 26, 2004 10:14 AM
Subject: [JDBC] executeUpdate() deadlock

Hi!

It seems, this isn't my day. I made a mistake in my program, and a new
bug (?) cropped up. Once again, the JDBC API is not clear about it. So i
thought i ask here the professionals.:)

The situation is as follows:

There are 2 connections (A) and (B).
(A) begins a transaction, and executes some selects, updates, etc... on
the table (T).
(A) closes all results and statements. (But doesn't commit!)
(B) tries to drop the table (T) before (A) was committed/rolled back or
and/or closed.

The current jdbc driver stops the thread execution in the
executeUpdate() method which tries to drop the table. I guess it waits
for (A) to get closed/committed/rolled back.

Is this the correct way or should it throw an SQLException?
I'm confused about it. If somebody knows the answer, please let me
known. Thank you!

Chris

Environment:
PostgreSQL 7.4.1 (on a debian Linux with kernel 2.4.20)
JDBC Driver: fresh CVS version (from gborg)

--
Fischer Krisztián <fischer(at)borganization(dot)com>
Tel: (+36)70/3843835, (+36)1/3360547
Borganization Kft.

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Fischer Krisztián 2004-01-26 13:19:31 Re: executeUpdate() deadlock
Previous Message Fischer Krisztián 2004-01-26 12:14:00 executeUpdate() deadlock