Hibernate Envers with Spring using HibernateTemplate

柔情痞子 提交于 2019-12-06 06:53:41

The problem is caused by the fact that Envers relies on proper transaction management, whereas HibernateTemplate falls back to "auto-commit" mode when used outside of transaction, so that Envers doesn't work in this case.

Therefore you need to configure transaction management in order to use Envers. When HibernateTemplate's methods are called inside a transaction, Envers works fine.

See also:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!