I included the relevant settings from our hibernate config file. We use WLS 8.1 SP6.
Code:
<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">
jta
</property>
<!-- Transaction management -->
<property name="hibernate.transaction.factory_class">
org.hibernate.transaction.CMTTransactionFactory
</property>
<property name="hibernate.transaction.manager_lookup_class">
org.hibernate.transaction.WeblogicTransactionManagerLookup
</property>
<property name="hibernate.transaction.flush_before_completion">
true
</property>
<property name="hibernate.connection.release_mode">
auto
</property>
<property name="hibernate.order_updates">
true
</property>
Try changing the transaction factory class from JTATransactionFactory to CMTTransactionFactory:
<property name="hibernate.transaction.factory_class">
org.hibernate.transaction.JTATransactionFactory
</property>
<property name="hibernate.transaction.factory_class">
org.hibernate.transaction.CMTTransactionFactory
</property>
And adding:
<property name="current_session_context_class">
jta
</property>
Retest calling getCurrentSession() instead of openSession() and post your results. Also, please let us know what version of Hibernate you are using. I seem to remember a similar problem in our environment when we tried a release candidate of Hibernate 3.2. We are currently using Hibernate 3.1.
Grant