Re: Access to transaction status

Поиск
Список
Период
Сортировка
От Jeroen T. Vermeulen
Тема Re: Access to transaction status
Дата
Msg-id 20030619165018.GA66196@xs4all.nl
обсуждение исходный текст
Ответ на Access to transaction status  ("Christian Plattner" <postgresql@sioux.ch>)
Список pgsql-hackers
On Thu, Jun 19, 2003 at 05:16:10PM +0200, Christian Plattner wrote:
> 
> Do be able to handle all sorts of failures I needed two functions:
> 
> - A function to get the current XID
> - A function which I can use later to tell if a given XID
> commited/aborted/whatever

I ran into the same need (Bruce, we discussed this at FOSDEM in Brussels
this February) for libpqxx.  My code tries to compensate for the 
possibility that the backend connection is lost while waiting for a reply
to a COMMIT.  The way I worked around it was to create a special record 
at the beginning of the transaction, in a dedicated table that's 
effectively a custom transaction log.  If the record is still there when
I reconnect, the transaction committed.  If not, it didn't.

Obviously this leaves some garbage collection issues, so I'd be really
happy with a way to go back to the server after my connection is lost 
and find out whether my transaction committed or not.


Jeroen



В списке pgsql-hackers по дате отправления:

Предыдущее
От: ivan
Дата:
Сообщение: same new code
Следующее
От: "Enke, Michael"
Дата:
Сообщение: again: Bug #943: Server-Encoding from EUC_TW to UTF-8 doesn'twork