You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/06/16 03:36:27 UTC

[GitHub] [shardingsphere] zjinlei commented on a change in pull request #6042: optimize lifecycle management of ShardingTransactionType

zjinlei commented on a change in pull request #6042:
URL: https://github.com/apache/shardingsphere/pull/6042#discussion_r440567475



##########
File path: examples/shardingsphere-jdbc-example/transaction-example/transaction-2pc-xa-bitronix-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/transaction/xa/bitronix/raw/jdbc/OrderServiceImpl.java
##########
@@ -65,6 +65,8 @@ public void processSuccess() throws SQLException {
             doInsert(preparedStatement);
             connection.commit();
             System.out.println("INSERT 10 orders success");
+        } finally {
+            TransactionTypeHolder.clear();

Review comment:
       I removed TransactionTypeHolder.clear() of AbstractConndectionAdapter#close, I think this is not the behavior of connnection.
   TransactionTypeHolder set and clear are symmetrical behaviors, and the caller should maintain them together.




----------------------------------------------------------------
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.

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