ulwx opened a new issue, #24332:
URL: https://github.com/apache/shardingsphere/issues/24332

   ```
   GlobalTransaction globalTransaction = 
GlobalTransactionContext.getCurrentOrCreate();
   globalTransaction.begin(timeout * 1000);     
   TransactionTypeHolder.set(TransactionType.BASE);
   try{
       doInsert();
   }finally {
       TransactionTypeHolder.clear();
   }
   globalTransaction.commit();
   ```
   When the above code is running, doInsert() will throw a null exception, 
which is thrown by the commit() method in doInsert(). The reason is that when 
the shardingjdbc proxy commit() method is used, because the 
SeataATShardingSphereTransactionManager # begin() method has not been executed 
because of the existence of GlobalTransaction on the periphery, the 
TransactionTypeHolder # set() method has not been executed and is always empty, 
Thus, when the shardingjdbc agent commit() method is executed, the query is 
null through TransactionTypeHolder # get(), and a null pointer exception is 
reported!
   


-- 
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: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to