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

   ```
   GlobalTransaction globalTransaction = 
GlobalTransactionContext.getCurrentOrCreate();
   globalTransaction.begin(timeout * 1000);     
   TransactionTypeHolder.set(TransactionType.BASE);
   try{
       doInsert();
   }finally {
       TransactionTypeHolder.clear();
   }
   globalTransaction.commit();
   ```
   
上述代码运行时,doInsert()会抛出null异常,是doInsert()里的commit()方法抛出的,原因是shardingjdbc代理commit()方法时,由于SeataATShardingSphereTransactionManager#begin()方法因为外围存在GlobalTransaction而一直没有执行,导致TransactionTypeHolder#set()没有执行,一直为空,从而在shardingjdbc代理commit()方法执行时通过TransactionTypeHolder#get()查询为空,报null指针异常


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