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>