• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Hibernate's CurrentSessionContext with Spring's Transaction Manager

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm curious to know how Hibernate's 'current_session_context_class' declaration will disable the Spring's HibernateTransactionManager?



I found that the above two can not exist together for same SessionFactory.
Kindly ley me know what is the role of Spring's HibernateTransactionManager in defining scope for Hibernate's Session context?

 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does this thread help at all?
https://coderanch.com/t/590071/ORM/databases/org-hibernate-SessionException-Session-closed

What Spring does is it creates an instance of SpringSessionContext which allows you to retrieve the spring managed session for the current thread if it exists. If you want your session factory to be transaction aware this is required. By providing your own value for this property you are overriding this behavior.

See the java doc for

setExposeTransactionAwareSessionFactory on the AbstractSessionFactoryBean
 
Srinivas Kothuri
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Bill. The link you shared gave me more insight.
 
You learn how to close your eyes and tell yourself "this just isn't really happening to me." Tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic