views:

230

answers:

1

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/> 

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!

A: 

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...

hamo