Okay, let's go for modified commit() and rollback(). I will make tpc off by default in ZStorm and have a way to configure it per-store, because you might don't want to have it on for all stores, for example if they set the isolation level to autocommit (tpc is not supported), something like zstorm.set_default_tpc(name, flag), and maybe have a way to configure it per-transaction too.
Regarding begin(), I think we need it because the ZStorm machinery needs to call it when during register_store_with_transaction, afaiu you need to call the DB API level tpc_begin() before issuing any query in the transaction. So prepare() alone is not enough, unless we are fine with ZStorm accessing the raw connection directly via store._connection._raw_connection (but that doesn't seem great).
My idea would be to add a Storm-level Xid class, that you can instantiate passing the standard XA arguments (format, transaction_id, branch_qualifier). Then you can pass Xid instances to store.begin(), and they would be handled transparently.
If you think we should move this to the mailing list, I'll do.
Hi Stuart,
thanks for the comments!
Okay, let's go for modified commit() and rollback(). I will make tpc off by default in ZStorm and have a way to configure it per-store, because you might don't want to have it on for all stores, for example if they set the isolation level to autocommit (tpc is not supported), something like zstorm. set_default_ tpc(name, flag), and maybe have a way to configure it per-transaction too.
Regarding begin(), I think we need it because the ZStorm machinery needs to call it when during register_ store_with_ transaction, afaiu you need to call the DB API level tpc_begin() before issuing any query in the transaction. So prepare() alone is not enough, unless we are fine with ZStorm accessing the raw connection directly via store._ connection. _raw_connection (but that doesn't seem great).
My idea would be to add a Storm-level Xid class, that you can instantiate passing the standard XA arguments (format, transaction_id, branch_qualifier). Then you can pass Xid instances to store.begin(), and they would be handled transparently.
If you think we should move this to the mailing list, I'll do.