WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter.getStatus() implemented incorrect

Description

In our in-container-configuration (WebSphere 6.0.2.x), we get the following Exception since moving from Hibernate 3.1.3 to 3.2.6 (Problem also occurs with 3.2.5):

Caused by: com.ing.diba.mws.tcore.exception.logging.ConvertedException: org.hibernate.TransactionException: could not register synchronization with JTA Transa
ctionManager [Error code: MWS-6001: "Technischer Fehler"]
at org.hibernate.jdbc.JDBCContext.registerSynchronizationIfPossible(JDBCContext.java:185)
at org.hibernate.jdbc.JDBCContext.<init>(JDBCContext.java:76)
at org.hibernate.impl.SessionImpl.<init>(SessionImpl.java:213)
at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:473)
at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:497)
at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:505)
at com.ing.diba.mws.tcore.persistence.HibernateSessionSourceImpl.createPersistenceProvider(HibernateSessionSourceImpl.java:45)
...removed irrelevant lines...
at com.ing.diba.mws.tcore.service.remoting.ejb.EJSLocalStatelessRemoteInvoker_d8103d48.invoke(Unknown Source)
at com.ing.diba.mws.tcore.service.remoting.RemotingInterceptorLocalEJB.invoke(RemotingInterceptorLocalEJB.java:90)
... 57 more
Caused by: java.lang.UnsupportedOperationException
at org.hibernate.transaction.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter.getStatus(WebSphereExtendedJTATransactionLookup.java:87)
at org.hibernate.transaction.JTATransactionFactory.isTransactionInProgress(JTATransactionFactory.java:94)
at org.hibernate.jdbc.JDBCContext.isTransactionInProgress(JDBCContext.java:191)
at org.hibernate.jdbc.JDBCContext.registerSynchronizationIfPossible(JDBCContext.java:159)
... 154 more

Our hibernate configuration contains the following settings:

hibernate.transaction.manager_lookup_class=org.hibernate.transaction.WebSphereExtendedJTATransactionLookup
hibernate.transaction.factory_class=org.hibernate.transaction.JTATransactionFactory

It seems that getStatus() of the inner class TransactionManagerAdapter is invoked and throws the UnsupportedOperationException. Instead of doing that, it probably should delegate to the getStatus() method of the inner-inner class TransactionAdapter like this:

public int getStatus() throws SystemException {
return getTransaction().getStatus();
}

At least after patching that in Hibernate-3.2.6 and deploying the patched hibernate3.jar, the problem disappeared.

Environment

Hibernate-3.2.6, Oracle 9i, IBM WebSphere 6.0.2.17 using JTATransactions

Activity

Show:
Chris Bredesen
February 22, 2008, 6:05 PM

Yes, the correct thing here is to null-check the Transaction and return Status.NO_TRANSACTION if there isn't one.

Faizal Abdoelrahman
March 5, 2008, 4:18 PM

I too am experiencing this (websphere 6.1.13 , hibernate 3.2.5 ).

Chris Bredesen
March 6, 2008, 7:05 PM

fixed in trunk / 3.2

Former user
June 9, 2008, 11:13 PM

When will this fix be available in a build? If not soon, can someone post a few steps on how to patch my 3.2.6 build?

Thnx

Steve Ebersole
March 21, 2011, 7:04 PM

Bulk closing stale resolved issues

Assignee

Chris Bredesen

Reporter

Felix von Delius

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Critical
Configure