You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "slievrly (via GitHub)" <gi...@apache.org> on 2025/01/03 03:47:54 UTC

Re: [PR] feature:[loom] replace the usages of synchronized with ReentrantLock [incubator-seata]

slievrly commented on code in PR #7073:
URL: https://github.com/apache/incubator-seata/pull/7073#discussion_r1901447100


##########
rm-datasource/src/main/java/org/apache/seata/rm/datasource/xa/ConnectionProxyXA.java:
##########
@@ -127,10 +130,12 @@ private void xaEnd(XAXid xaXid, int flags) throws XAException {
      * @param applicationData application data
      * @throws SQLException SQLException
      */
-    public synchronized void xaCommit(String xid, long branchId, String applicationData) throws XAException {
-        XAXid xaXid = XAXidBuilder.build(xid, branchId);
-        xaResource.commit(xaXid, false);
-        releaseIfNecessary();
+    public void xaCommit(String xid, long branchId, String applicationData) throws XAException {

Review Comment:
   Is there a more elegant way to write code? resourceLock.obtain() is more complex than the synchronized keyword.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org