File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional" Watch "No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional" New topic
Author

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

juniad Ahmed
Greenhorn

Joined: Feb 19, 2011
Posts: 24
Hi Guys,

I know this question has been asked before, but i could not find a solution for my problem.

I am implementing Spring security with database authentication. When i launch the application, login page is displayed, but when i click on submit, it gives No Hibernate Session bound to thread exception.

Please guys help me out.





Please guys help me out
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Not sure if this is the reason. But in one of your services I see you set @Transactional(propagation=Propagation.SUPPORTS)

SUPPORTS means that that method may or may not run in a Transaction. It depends on the caller if it started a Transaction. If the caller is not already running in a Transaction, then that second service will not run in a Transaction.

So, it means that it is possible that that method is running without a Transaction and Hibernate requires that a Transaction is always running in order to do its work.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional
 
Similar Threads
I am getting org.springframework.orm.hibernate3.HibernateSystemException: Unknown entity:
Exception on Save operation with Spring annotation
Dependency injection problem
parent key not found, Save two connected objects
Error with Transaction Interceptor