Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 822CB9FB272 for ; Mon, 30 Oct 2006 15:23:04 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 25470-05 for ; Mon, 30 Oct 2006 15:23:00 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.ukfsn.org (s2.ukfsn.org [217.158.120.143]) by postgresql.org (Postfix) with ESMTP id 0C0A79FA376 for ; Mon, 30 Oct 2006 15:22:59 -0400 (AST) Received: from stargate (84-45-236-142.no-dns-yet.enta.net [84.45.236.142]) by mail.ukfsn.org (Postfix) with ESMTP id D5172E70B3 for ; Mon, 30 Oct 2006 19:20:24 +0000 (GMT) From: David Goodenough To: pgsql-jdbc@postgresql.org Subject: Re: confused about transactions and connection pools Date: Mon, 30 Oct 2006 19:22:55 +0000 User-Agent: KMail/1.9.4 References: <200610301117.54932.david.goodenough@btconnect.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200610301922.55897.david.goodenough@btconnect.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200610/142 X-Sequence-Number: 16025 On Monday 30 October 2006 18:40, Kris Jurka wrote: > On Mon, 30 Oct 2006, David Goodenough wrote: > > The we get to the second time through the servlet. First thing - no > > BEGIN or ROLLBACK, but the code went through a call to > > connection.setAutoCommit( false). Secondly this odd statement that I do > > not recognise id no longer there. > > For each connection the statements BEGIN, ROLLBACK, and COMMIT are only > prepared once and after that they are executed again and again. This can > be very confusing when looking at the logs which only show the preparation > step, but not execution. So even though you can't see them, they're being > executed. The 8.2 release will be the first release that can accurately > log this usage pattern. > > Kris Jurka is it only the BEGIN, ROLLBACK and COMMIT that are only shown when being prepared? I ask because all the statement are PreparedStatements and they get prepared each time we get a new connection, which I understand means that they prepared for real first time they are used, but are then cached and therefore that one should always use substitutable ? paramaters so that the statement is always the same. If only the prepares are being logged then the pool is obviously not working as the insert into the logs table get logged each time through. I am now more confused. David