首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Server分布式事务: xp_sqljdbc_xa_commit与xp_sqljdbc_xa_end

Server分布式事务: xp_sqljdbc_xa_commit与xp_sqljdbc_xa_end
EN

Database Administration用户
提问于 2020-09-08 17:14:39
回答 1查看 248关注 0票数 0

在Server 2019中,有人能确切地告诉我xp_sqljdbc_xa_commit和xp_sqljdbc_xa_end之间的功能区别吗?

我猜提交是试图提交事务(谢谢,先生,显而易见;-)和结束告诉DTC“嘿,都在这里,请清理。”

但是,代码似乎存在于SQLJDBC_XA.dll (作为扩展sp)中,所以我无法查看它,也找不到一个很好的参考来证实我的假设。

谢谢!

EN

回答 1

Database Administration用户

回答已采纳

发布于 2020-09-08 20:34:01

驱动程序在GitHub上的源代码是跟踪这一点的一个很好的地方。

代码语言:javascript
复制
@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事务)

票数 1
EN
页面原文内容由Database Administration提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://dba.stackexchange.com/questions/275164

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档