liuyangming / ByteTCC

ByteTCC is a distributed transaction manager based on the TCC(Try/Confirm/Cancel) mechanism. It’s compatible with the JTA specification. User guide: https://github.com/liuyangming/ByteTCC/wiki
https://www.bytesoft.org/
GNU Lesser General Public License v3.0
2.9k stars 913 forks source link

是否支持部分service方法事务生效 #103

Closed g29times closed 5 years ago

g29times commented 5 years ago

有个service,有read()方法,有write()方法,最初只在write()方法增加了@Transaction,启动时报错,说read()方法没Transaction不行,在一个service里面不能只对部分方法生效吗?

liuyangming commented 5 years ago

byteTCC只检测interfaceClass指定接口中定义的方法。read操作不必用事务,就不必在interfaceClass指定接口中定义,也就可以不必定义@Transactional注解。但如果定义了,就需要加上。

g29times commented 5 years ago

OK