pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedTransaction state on connection Idle/Open/Failed
3+ messages / 2 participants
[nested] [flat]
* Transaction state on connection Idle/Open/Failed
@ 2019-08-16 19:57 David Wall <d.wall@computer.org>
0 siblings, 1 reply; 3+ messages in thread
From: David Wall @ 2019-08-16 19:57 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org; pgsql-jdbc@lists.postgresql.org
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Transaction state on connection Idle/Open/Failed
@ 2019-08-17 17:27 Adrian Klaver <adrian.klaver@aklaver.com>
parent: David Wall <d.wall@computer.org>
0 siblings, 1 reply; 3+ messages in thread
From: Adrian Klaver @ 2019-08-17 17:27 UTC (permalink / raw)
To: David Wall <d.wall@computer.org>; pgsql-general@lists.postgresql.org; pgsql-jdbc@lists.postgresql.org
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.klaver@aklaver.com
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Transaction state on connection Idle/Open/Failed
@ 2019-08-17 17:39 David Wall <d.wall@computer.org>
parent: Adrian Klaver <adrian.klaver@aklaver.com>
0 siblings, 0 replies; 3+ messages in thread
From: David Wall @ 2019-08-17 17:39 UTC (permalink / raw)
To: pgsql-jdbc@lists.postgresql.org
On 8/17/19 10:27 AM, Adrian Klaver wrote:
> https://jdbc.postgresql.org/development/privateapi/org/postgresql/core/ProtocolConnection.html
>
Thanks for the link. I'm not sure why I couldn't track that down...
And it makes sense. We did find a bug in our code where we returned a
Connection while it was still OPEN (missing commit before a web page
redirect).
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2019-08-17 17:39 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-08-16 19:57 Transaction state on connection Idle/Open/Failed David Wall <d.wall@computer.org>
2019-08-17 17:27 ` Adrian Klaver <adrian.klaver@aklaver.com>
2019-08-17 17:39 ` David Wall <d.wall@computer.org>
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