Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hyiMK-0007nG-KF for pgsql-general@arkaria.postgresql.org; Fri, 16 Aug 2019 19:58:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hyiMJ-0000BC-CC for pgsql-general@arkaria.postgresql.org; Fri, 16 Aug 2019 19:57:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hyiMJ-0000Az-2b; Fri, 16 Aug 2019 19:57:59 +0000 Received: from smtp80.iad3b.emailsrvr.com ([146.20.161.80]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hyiMF-0005QM-4B; Fri, 16 Aug 2019 19:57:58 +0000 X-Auth-ID: david.wall@myeastside.com Received: by smtp19.relay.iad3b.emailsrvr.com (Authenticated sender: david.wall-AT-myeastside.com) with ESMTPSA id 7410B4010F; Fri, 16 Aug 2019 15:57:51 -0400 (EDT) X-Sender-Id: david.wall@myeastside.com Received: from [10.138.21.190] (50-46-115-21.evrt.wa.frontiernet.net [50.46.115.21]) (using TLSv1.2 with cipher AES128-SHA) by 0.0.0.0:465 (trex/5.7.12); Fri, 16 Aug 2019 15:57:51 -0400 To: pgsql-general@lists.postgresql.org, pgsql-jdbc@lists.postgresql.org From: David Wall Subject: Transaction state on connection Idle/Open/Failed Message-ID: <07cb7902-20a3-b139-096d-cdfffca7d3cd@computer.org> Date: Fri, 16 Aug 2019 12:57:50 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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