在Server 2019中,有人能确切地告诉我xp_sqljdbc_xa_commit和xp_sqljdbc_xa_end之间的功能区别吗?
我猜提交是试图提交事务(谢谢,先生,显而易见;-)和结束告诉DTC“嘿,都在这里,请清理。”
但是,代码似乎存在于SQLJDBC_XA.dll (作为扩展sp)中,所以我无法查看它,也找不到一个很好的参考来证实我的假设。
谢谢!
发布于 2020-09-08 20:34:01
驱动程序在GitHub上的源代码是跟踪这一点的一个很好的地方。
@Override
public void end(Xid xid, int flags) throws XAException {
// Called by the transaction mgr after the app closes the connection it was given from this physical
// connection
/*
* Ends the work performed on behalf of a transaction branch. The resource manager disassociates the XA resource
* from the transaction branch specified and let the transaction be completed. If TMSUSPEND is specified in
* flags, the transaction branch is temporarily suspended in incomplete state. The transaction context is in
* suspened state and must be resumed via start with TMRESUME specified. If TMFAIL is specified, the portion of
* work has failed. The resource manager may mark the transaction as rollback-only. If TMSUCCESS is specified,
* the portion of work has completed successfully.
*/
DTC_XA_Interface(XA_END, xid, flags | tightlyCoupled);
}src/main/java/com/microsoft/sqlserver/jdbc/SQLServerXAResource.java
所以它被Server的XAResource接口的实现所使用。
有关背景信息,请参阅如何工作:(MSDTC和XA事务)
https://dba.stackexchange.com/questions/275164
复制相似问题