> Look at isc_prepare_transaction2() API. It could attach *any* > application-specific > message to the local transaction before actual commit. TM could pass XID + > "something > to identify this part of distributed transaction" into > isc_prepare_transaction and later read > this info back from RDB$TRANSACTIONS at recovery phase, if necessary. And\or > TM > could store above "something to identify this part of distributed > transaction" + local TxID > of every part of distributed transaction into its own storage before start > distributed commit > (to identify record at RDB$TRANSACTIONS later at recovery phase). > > Look also at isc_reconnect_transaction() API which allows to re-connect > to the in-limbo > transaction at recovery phase and finally commit or rollback it.
This code should be already working in Jaybird since day 0 (David Jencks implemented it in the first version of the driver). The recovery process uses message to query the in-limbo transactions, is able to join them and is able to commit or rollback them. However, if I remember correctly, the requirement to support transaction independent from the attachment came from the fact that TM may be asked to activate a transaction that "belongs" to the attachment that is being currently used and is associated with a different transaction. Here we talk about normal processing, not the recovery process. I guess the main issue here is the synchronization of the wire communication, so that two transactions are properly interleaved and server is able to handle the communication. Another issue here is that when a non-recoverable error happens (e.g. request synchronisation error), we have to kill all transactions that belong to that attachment, even if only one is in trouble. But this requirement is so old, that I do not remember exact details. The only thing I remember is that it becomes obvious when somebody starts refactoring the XA part (which is one of the core layers there). That happened to me when I refactored that code few years ago, that's happening to Mark right now. :) Roman ------------------------------------------------------------------------------ Special Offer -- Download ArcSight Logger for FREE! Finally, a world-class log management solution at an even better price-free! And you'll get a free "Love Thy Logs" t-shirt when you download Logger. Secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsisghtdev2dev Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel