Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
So it takes a day for light to pass through this glass? So this was yesterday's tiny ad?
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic