开发者

Applying additional aspectj around advice to a spring transactional method

I have a spring 2.5 + hibernate webapp with transaction annotations and everything works fine.

I now want to add a fairly basic aspect with 'around' advice and apply it to my service layer (which is transactional). I am doing this using aspectj annotations and placed

<aop:aspectj-autoproxy/> 开发者_JS百科

in my spring xml.

Spring transactional unit tests show it working no problems, however once I run it in tomcat I get a:

"No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here."

It's as if the aspectj autoproxy is blowing away the previously declared transactional annotations.

Has anyone seen this before? I attempted to google the issue but most examples don't show adding around advice to a transactional annotated method.

Cheers!


Wow, I just wasted 2 hours on this problem until I realised I had deleted:

<tx:annotation-driven/>

I'm feeling pretty smart right now...

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜