Re: confused about transactions and connection pools

From: David Goodenough <david(dot)goodenough(at)btconnect(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: confused about transactions and connection pools
Date: 2006-10-30 19:22:55
Message-ID: 200610301922.55897.david.goodenough@btconnect.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Marc Herbert 2006-10-30 19:26:17 Re: altered records
Previous Message Kris Jurka 2006-10-30 19:07:00 Re: Postgres XA support