pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Wall <d.wall@computer.org>
To: pgsql-general@lists.postgresql.org
To: pgsql-jdbc@lists.postgresql.org
Subject: Transaction state on connection Idle/Open/Failed
Date: Fri, 16 Aug 2019 12:57:50 -0700
Message-ID: <07cb7902-20a3-b139-096d-cdfffca7d3cd@computer.org> (raw)

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.

Thanks,
David






view thread (3+ messages)  latest in thread

Message-ID: <07cb7902-20a3-b139-096d-cdfffca7d3cd@computer.org>
Permalink:  ../07cb7902-20a3-b139-096d-cdfffca7d3cd@computer.org/
Also on:    postgresql.org/message-id/07cb7902-20a3-b139-096d-cdfffca7d3cd@computer.org

 · 

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: d.wall@computer.org, pgsql-general@lists.postgresql.org
  Subject: Re: Transaction state on connection Idle/Open/Failed
  In-Reply-To: <07cb7902-20a3-b139-096d-cdfffca7d3cd@computer.org>
  References: <07cb7902-20a3-b139-096d-cdfffca7d3cd@computer.org>

* 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