Received: from smtp3.jp.psi.net (smtp3.jp.psi.net [154.33.63.113]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f17A44x32387 for ; Wed, 7 Feb 2001 05:04:04 -0500 (EST) (envelope-from rmager@vgkk.com) Received: from [211.120.7.246] (helo=rmagervm) by smtp3.jp.psi.net with smtp (Exim 3.12 #1) id 14QRSC-0007vS-00 for pgsql-admin@postgresql.org; Wed, 07 Feb 2001 19:04:00 +0900 From: "Rainer Mager" To: Subject: Problem with JDBC transactions Date: Wed, 7 Feb 2001 19:03:10 +0900 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Importance: Normal X-Archive-Number: 200102/53 X-Sequence-Number: 653 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