AuditException:由于非活动事务而无法创建修订
我一直在更新我的应用程序框架,现在我正在尝试使用JPA配置hibernate envers来审计一些域。
审计失败时,常规持久性正常,但错误如下
我有这个错误
org.springframework.orm.hibernate4.HibernateSystemException: Unable to create revision because of non-active transaction; nested exception is org.hibernate.envers.exception.AuditException: Unable to create revision because of non-active transaction at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:218) at org.springframework.orm.hibernate4.SpringSessionSynchronization.beforeCommit(SpringSessionSynchronization.java:107) ....
我的配置是:
true org.hibernate.dialect.MySQLDialect update org.hibernate.cfg.ImprovedNamingStrategy true org.hibernate.dialect.MySQLDialect true validate com.lotjm.domain.User com.lotjm.domain.Application com.lotjm.domain.Project com.lotjm.domain.Document com.lotjm.domain.AbstractAuditingEntity
有关如何修复它的任何建议?
TKS
在我们的Dao Class函数之前添加@Transactional,这个sol
- 如何在Spring Data中按示例查询在两个日期之间添加限制范围
- 如何在hibernate中使用union执行查询?
- Spring应用程序似乎不是持久化数据
- 推荐的处理spring hibernate SQL错误的方法
- Hibernate org.hibernate.LazyInitializationException:懒得初始化角色集合:
- 使用JPA和Hibernate时@Size,@ Longth和@Column(length = value)之间的区别
- 错误:传递给持久化的分离实体 – 尝试持久化复杂数据(Play-Framework)
- Hibernate中的三元(和n-ary)关系
- 通过查询来hibernate多对多数据检索