Re: Transaction state on connection Idle/Open/Failed

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: David Wall <d(dot)wall(at)computer(dot)org>, pgsql-general(at)lists(dot)postgresql(dot)org, pgsql-jdbc(at)lists(dot)postgresql(dot)org
Subject: Re: Transaction state on connection Idle/Open/Failed
Date: 2019-08-17 17:27:04
Message-ID: 4de2983b-605c-67ff-df3b-420d06f2aa30@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-jdbc

On 8/16/19 12:57 PM, David Wall wrote:
> In JDBC (latest version), I'm using the
> org.postgresql.jdbc.PgConnection.getTransactionState() that returns an
> enumeration of IDLE, OPEN or FAILED.
>
> I am familiar with IDLE, meaning the connection has a new transaction
> started, but isn't doing anything.  We think of this as the "normal"
> state for our connections.
>
> How does OPEN compare to IDLE?  If we stop using a connection that's in
> the OPEN state, is something wrong?  That is, does it have pending
> updates that require a commit/rollback?
>
> Same for FAILED.  If we no longer need a connection in the FAILED state,
> is something wrong?  Does it have pending updates that require a
> commit/rollback (assuming in this state rollback makes more sense).
>
> I'm really trying to find out what it means for the connection to be in
> OPEN or FAILED states compared to IDLE.

https://jdbc.postgresql.org/development/privateapi/org/postgresql/core/ProtocolConnection.html

>
> Thanks,
> David
>
>
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2019-08-17 17:32:40 Re: Unexpected "canceling statement due to user request" error
Previous Message Luca Ferrari 2019-08-17 15:52:59 Re: Question on pgwatch

Browse pgsql-jdbc by date

  From Date Subject
Next Message David Wall 2019-08-17 17:39:57 Re: Transaction state on connection Idle/Open/Failed
Previous Message David Wall 2019-08-16 19:57:50 Transaction state on connection Idle/Open/Failed