我遇到了Spring + JTA的麻烦!
我有一个注释到@Transactional(propagation=Propagation.REQUIRES_NEW)
的函数,当我存储大量数据时,这个函数运行良好。但是当我尝试在quartzJob抛出的循环中迭代并修改它们时,我得到了一个例外。
JTA transaction unexpectedly rolled back (maybe due to a timeout); nested exception is javax.transaction.RollbackException: The transaction was set to rollback only