dromara / hmily

Distributed transaction solutions
https://dromara.org
Apache License 2.0
4.11k stars 1.41k forks source link

全局事务id怎么获取? #327

Open Masquerade6 opened 2 years ago

Masquerade6 commented 2 years ago

Long transId = HmilyContextHolder.get().getTransId(); Long transId = HmilyTransactionHolder.getInstance().getCurrentTransaction().getTransId();

只有在事务发起方才能得到事务id,其它地方调用HmilyContextHolder.get()和HmilyTransactionHolder.getInstance().getCurrentTransaction()拿到的都是null?这是bug还是使用不对?

clclo121 commented 1 year ago

存在threadLocal中的