(暂)通常是因为不适当的flush() 引起异常的 。。。
When persisting a transient entity during manual flush, an exception
"javax.persistence.TransactionRequiredException: no transaction is in
progress" is thrown, unless getEntityManager().joinTransaction() is
executed prior to flush() - despite declaring the POJO as
@Transactional and using Seam-managed transactions and persistence
contexts.
When persisting a managed entity, however, no exceptions are thrown and update completes normally.
手动flush时的事务异常
本文探讨了在手动flush操作中遇到的javax.persistence.TransactionRequiredException异常问题。该问题通常发生在尝试保存瞬态实体时,除非事先调用了getEntityManager().joinTransaction()。对于托管实体的持久化操作则不会出现此类异常。
6652

被折叠的 条评论
为什么被折叠?



