Hi - I am experimenting with the transaction handling in Hibernate in conjunction with Container Managed Transactions with EJBs deployed on Websphere 5.0.
I have the following settings in my hibernate.xfg.xml:
Code:
<property name="hibernate.connection.driver_class">
COM.ibm.db2.jdbc.app.DB2Driver</property>
<property name="hibernate.connection.url">jdbc:db2:sample</property>
<property name="hibernate.connection.username">db2admin</property>
<property name="hibernate.connection.password">db2admin</property>
<property name="dialect">net.sf.hibernate.dialect.DB2Dialect</property>
<property name="show_sql">true</property>
<property name="use_outer_join">true</property>
<property name="hibernate.transaction.factory_class">
net.sf.hibernate.transaction.JTATransactionFactory
</property>
<property name="hibernate.transaction.manager_lookup_class">
net.sf.hibernate.transaction.WebSphereTransactionManagerLookup
</property>
<property name="jta.UserTransaction">
java:comp/UserTransaction
</property>
I have a session bean that is deployed with Container Managed Transactions, and RequiresNew on the method that calls my DAO which contains my Hibernate code.
When I call session.beginTransaction() in my DAO I get the following exception:
Code:
net.sf.hibernate.transaction.JTATransaction TRAS0014I: The following exception was logged javax.naming.NameNotFoundException: Name "comp/UserTransaction" not found in context "java:".
Assuming that the UserTransaction is java:comp/UserTransaction in Webpshere, which I think it is, then what does this mean?
Have I configured this correctly? Is what I am trying to do a valid use of Websphere transactions with Hibernate? How do I get Hibernate transactions to participate in the same transaction that is started by my EJB?
Thanks,
Kevin Hooke