Hi,
I'm using Hibernate 2.1.1, Windows 2000, Jdk 1.3, WebSphere 4.02 and DB2 7.2. I'm having trouble using a websphere datasource. Here's what I do:
Code:
Session session = null;
try {
session = SessionFactoryPlant.getSessionFactory().openSession( new RKTInterceptor());
session.saveOrUpdate(case);
} catch( HibernateException e ) {
LOGGER.debug( "An HibernateException occured during saving, thrown as a PersistException", e );
throw new PersistException( e );
} finally {
if (session != null && session.isOpen() ) {
try {
session.close();
} catch (HibernateException h) {
LOGGER.warn("Exception while closing session.", h);
}
}
}
This result in the following exception:
Code:
javax.transaction.TransactionRolledbackException: CORBA TRANSACTION_ROLLEDBACK 0 No;
nested exception is:
org.omg.CORBA.TRANSACTION_ROLLEDBACK: com.ibm.websphere.csi.CSITransactionRolledbackException:
at com.ibm.ejs.csi.TranStrategy.commit(TranStrategy.java:194)
at com.ibm.ejs.csi.TranStrategy.postInvoke(TranStrategy.java:67)
at com.ibm.ejs.csi.TransactionControlImpl.postInvoke(TransactionControlImpl.java:414)
at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:1772)
Here's the hibernate.cfg.xml:
Code:
<hibernate-configuration>
<session-factory>
<property name="show_sql">true</property>
<property name="dialect">net.sf.hibernate.dialect.DB2Dialect</property>
<property name="hibernate.transaction.factory_class">net.sf.hibernate.transaction.JDBCTransactionFactory</property>
<!-- Database properties, in app server environment -->
<property name="hibernate.connection.datasource">jdbc/rkt</property>
Any ideas on what I'm doing wrong? All help appreciated!
Regards,
Ola