I am going to use Postgres as resourse manager in Tuxedo XA-transactions.
As I recently learned Postgres doesn't support transaction migration between threads of control,
so I cannot in one transaction update some data in one service,
then call other service and see updated data in it,
because each service has its own database connection and
transaction cannot be associated with other connection.
I prepared XA resource manager switch for Postgres.
In xa_switch_t structure I set flag to TMNOMIGRATE.
In the implementation of xa_prepare() I execute "PREPARE TRANSACTION 'xid'".
This Postgres command should be executed inside transaction block, i.e. on connection
where I update my data. When I run my test program I see that xa_prepare()
was called not by my service, but by transaction manager server,
which has other database connection. Can I change this behaviour using Tuxedo settings
or I need to execute "PREPARE TRANSACTION 'xid'" directly inside my service?
How many resource managers in your transaction?
In my transaction take part two resource managers.