Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Possible values of current_session_context_class property in hibernate and uses

I wanted to know all possible values that can be used with current_session_context_class property in cfg.xml file? I have an idea of thread value that makes the session context to relate per thread, like propertyname="current_session_context_class" thread.

like image 437
JavaCreature Avatar asked Aug 24 '13 19:08

JavaCreature


1 Answers

For Hibernate 4 valid values include:

  1. jta, thread, and managed (which are aliases for implementations delivered with Hibernate).
  2. full class name with package to any other custom class that implements org.hibernate.context.spi.CurrentSessionContext

This is told in Hibernate manual - 2.3. Contextual sessions

like image 59
Mikko Maunu Avatar answered Oct 05 '22 14:10

Mikko Maunu