Hibernate gives “No CurrentSessionContext configured” error

If you use Hibernate in a managed environment (with JBoss or some other AS that Hibernate supoorts). Add this line to session-factory section:

<property name=”hibernate.current_session_context_class” >jta </property>

If you use Hibernate in a non-managed environment (standalone application with JDBC). Add this line:

<property name=”hibernate.current_session_context_class” >thread </property>

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.