Nothing was stored in database when mode=aspectj
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.
精彩评论