pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Goodenough <david.goodenough@btconnect.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: confused about transactions and connection pools
Date: Mon, 30 Oct 2006 19:22:55 +0000
Message-ID: <200610301922.55897.david.goodenough@btconnect.com> (raw)
In-Reply-To: <Pine.BSO.4.63.0610301337200.2855@leary2.csoft.net>
References: <200610301117.54932.david.goodenough@btconnect.com>
	<Pine.BSO.4.63.0610301337200.2855@leary2.csoft.net>

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



view thread (12+ messages)  latest in thread

Message-ID: <200610301922.55897.david.goodenough@btconnect.com>
Permalink:  ../200610301922.55897.david.goodenough@btconnect.com/
Also on:    postgresql.org/message-id/200610301922.55897.david.goodenough@btconnect.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: david.goodenough@btconnect.com
  Subject: Re: confused about transactions and connection pools
  In-Reply-To: <200610301922.55897.david.goodenough@btconnect.com>
  References: <200610301117.54932.david.goodenough@btconnect.com> <Pine.BSO.4.63.0610301337200.2855@leary2.csoft.net> <200610301922.55897.david.goodenough@btconnect.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox