开发者

Nothing was stored in database when mode=aspectj

开发者 https://www.devze.com 2023-03-20 08:38 出处:网络
I build an application开发者_JS百科 which use Hibernate JPA2 + Spring. I have problem with transaction. I\'m using declarative transaction in my POJO classes. In context config I have next line:

I build an application开发者_JS百科 which use Hibernate JPA2 + Spring. I have problem with transaction. I'm using declarative transaction in my POJO classes. In context config I have next line:

<tx:annotation-driven mode="aspectj" transaction-manager="transactionManager"/>

I copy it from book. But when I try persist some of my entity to database, then nothing will be stored and no error or exception occurs. I tried remove attribute "mode" from xml tag, here it is:

<tx:annotation-driven transaction-manager="transactionManager"/>

After that all works fine. So for what is a "mode" attribute? When I remove it, then will be my transaction work correctly?


mode="aspectj" only works if you compile your code with the aspectj compiler (or have load-time weaving enabled) and have spring-aspects.jar on the classpath.

0

精彩评论

暂无评论...
验证码 换一张
取 消