11.03.2013

Spring + Hibernate + @Transaction

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

Assuming everything is in place as per the docs/tutorials out there one could almost miss this little thing.

only looks for @Transactional on beans in the same application context it is defined in.
This means that, if you put in a WebApplicationContext for a DispatcherServlet, it only checks for @Transactional beans in your controllers, and not your services.


No comments:

Post a Comment