Problem with JDBC transactions

From: "Rainer Mager" <rmager(at)vgkk(dot)com>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: Problem with JDBC transactions
Date: 2001-02-07 10:03:10
Message-ID: NEBBJBCAFMMNIHGDLFKGCEKKCPAA.rmager@vgkk.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

Hi all,

We're having some pretty serious problems with transactions via JDBC. We're
running on Linux with PG 7.0.3 and Sun's 1.2.2 Java VM.

The issue is that we have a reasonably large number of connections to our
database (as much as 80 simultaneously although the problem happens even at
around 30). What happens is that we have a transaction that 1) deletes all
items from a table for a given user ID, 2) inserts in the new items for that
user ID. This is wrapped in a single transaction. The problem is that
sometimes, the insert fails because the delete didn't actually delete
(apparently). I've put in debugging info and doing a query before and after
the delete bears this out, this is, the delete sometimes doesn't delete.
I've also looked at the postgres logs but it is very difficult to tell
where 1 connectios transaction starts compared to a differenct connection. I
think it would be useful if all lines were labeled with some sort of
connection ID.

Any way, has anyone seen anything like this? And before you ask, yes, we're
quite sure the code properly starts and ends a connection (well, we think
we're sure anyway ;-).

The only possibility I've been able to come up with is if we're
inadvertantly using the same JDBC connection more than once at a time. I've
looked into this a lot and it does not seem to be the case.

Any help would be GREATLY appreciated.

Thanks in advance.

--Rainer

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Jason Sanford 2001-02-07 15:57:17 RAM
Previous Message Peter T Mount 2001-02-07 08:40:29 Re: Re: [ADMIN]

Browse pgsql-general by date

  From Date Subject
Next Message Alexey Borzov 2001-02-07 10:12:19 Re: selecting a random record
Previous Message fabrizio.ermini 2001-02-07 09:45:16 Re: Re: PostreSQL SQL for MySQL SQL