Re: Detecting uncommitted changes - Mailing list pgsql-general

From Thomas Kellerer
Subject Re: Detecting uncommitted changes
Date
Msg-id jdd3u9$drp$1@dough.gmane.org
Whole thread Raw
In response to Re: Detecting uncommitted changes  (Bill Moran <wmoran@potentialtech.com>)
Responses Re: Detecting uncommitted changes  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Bill Moran wrote on 27.12.2011 19:37:
>> is there a way I can detect if the current session has any uncommitted changes?
>>
>> I'm not trying to find uncommitted changes from other sessions (connections) only for the *current* one.
>>
>> I thought there was a discussion on the mailing list that involved the txid_XXX functions, but I couldn't find that
anymore.
>>
>> Background:
>> I'm trying to implement a "Do you want to commit your changes?" question in a SQL tool, when the user closes the
application.
>
> If I'm understanding you correctly, you could just make it check the
> transaction status.  If there's an active transaction, then there are
> "uncommitted changes".
>

Sounds like what I want, but how do I check the "transaction status" (I'm using JDBC)

Regards
Thomas


pgsql-general by date:

Previous
From: Bill Moran
Date:
Subject: Re: Detecting uncommitted changes
Next
From: Jacques Lamothe
Date:
Subject: UNABLE TO CONNECT REMOTELY TO port 5436 - CRITICAL