[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2124?page=c...
]
Denis Forveille commented on HHH-2124:
--------------------------------------
Same problem for us (Hibernate v3.2.5 + Seam 1.2.1 + WebSphere v6.1.0.13)
The problem is occuring because an exception occured during the beforeCompletion method
triggered by the Transacation.commit(0 method, When the beforecompletion method throws an
exception, the commit() method may throw a RollbackException signifying that instead of
commiting the transaction, it rollbacked it. At that point it is illegal to perform a
rollback or setRollbackOnly on a transaction which is already rollbacked and is not active
anymore
I personally implemented another workaround:
- didnt' changed CacheSynchronization.java
- remove the "throw new UnsupportedOperationException()" line in
WebSphereExtendedJTATransactionLookup.TransactionAdapter.setRollbackOnly() method
I don't know whcih workaround is better...
However i don't understand why most of the method of the
WebSphereExtendedJTATransactionLookup.TransactionAdapter class throw
UnsupportedOperationException() ... Maybe it should be better to delegate the calls to the
underlying UserTransaction if it exists..
HibernateException hidden during flush using XA with WAS6
---------------------------------------------------------
Key: HHH-2124
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2124
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.1.2, 3.1.3
Environment: Hibernate 3.1.3
Oracle 10G
Websphere Application Server 6
Reporter: Ole Dalgaard
In an XA environment, using WebSphereExtendedJTATransactionLookup, HibernateExceptions
are hidden during flush in this code in CacheSynchronization.java
try {
if (flush) {
log.trace("automatically flushing session");
ctx.managedFlush();
}
}
catch (RuntimeException re) {
setRollbackOnly();
throw re;
}
After adding some logging to CacheSynchronization.beforeCompletion I got this error
message:
org.hibernate.HibernateException: Illegal attempt to associate a collection with two open
sessions
at
org.hibernate.collection.AbstractPersistentCollection.setCurrentSession(AbstractPersistentCollection.java:410)
at org.hibernate.event.def.OnUpdateVisitor.processCollection(OnUpdateVisitor.java:40)
at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java(Compiled
Code))
at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java(Compiled
Code))
at
org.hibernate.event.def.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java(Compiled
Code))
at org.hibernate.event.def.AbstractVisitor.process(AbstractVisitor.java:123)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performUpdate(DefaultSaveOrUpdateEventListener.java:267)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsDetached(DefaultSaveOrUpdateEventListener.java:216)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:502)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:494)
at org.hibernate.engine.CascadingAction$5.cascade(CascadingAction.java:134)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java(Inlined Compiled Code))
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java(Compiled Code))
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java(Compiled Code))
at org.hibernate.engine.Cascade.cascade(Cascade.java(Compiled Code))
at
org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:130)
at
org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:121)
at
org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:65)
at
org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:985)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:333)
at
org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:60)
at
org.hibernate.transaction.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter$TransactionAdapter$1.invoke(WebSphereExtendedJTATransactionLookup.java:136)
at $Proxy11.beforeCompletion(Unknown Source)
at
com.ibm.ws.jtaextensions.SynchronizationCallbackWrapper.beforeCompletion(SynchronizationCallbackWrapper.java:65)
at
com.ibm.ws.Transaction.JTA.RegisteredSyncs.distributeBefore(RegisteredSyncs.java(Compiled
Code))
at com.ibm.ws.Transaction.JTA.TransactionImpl.prePrepare(TransactionImpl.java(Compiled
Code))
at
com.ibm.ws.Transaction.JTA.TransactionImpl.stage1CommitProcessing(TransactionImpl.java(Compiled
Code))
at
com.ibm.ws.Transaction.JTA.TransactionImpl.processCommit(TransactionImpl.java(Compiled
Code))
at com.ibm.ws.Transaction.JTA.TransactionImpl.commit(TransactionImpl.java(Compiled
Code))
at com.ibm.ws.Transaction.JTA.TranManagerImpl.commit(TranManagerImpl.java(Compiled
Code))
at com.ibm.ws.Transaction.JTA.TranManagerSet.commit(TranManagerSet.java(Compiled Code))
at com.ibm.ejs.csi.TranStrategy.commit(TranStrategy.java:716)
at com.ibm.ejs.csi.TranStrategy.postInvoke(TranStrategy.java:167)
at com.ibm.ejs.csi.TransactionControlImpl.postInvoke(TransactionControlImpl.java:569)
at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:3801)
at
com.ibm.ws.webservices.dispatchers.ejb.WSEJBWrapper.postInvoke(WSEJBWrapper.java:153)
at
com.ibm.ws.webservices.dispatchers.ejb.J2ee14EJBDispatcher.cleanupEnvironment(J2ee14EJBDispatcher.java:197)
at
com.ibm.ws.webservices.engine.handlers.jaxrpc.JAXRPCHandler.invoke(JAXRPCHandler.java:148)
at com.ibm.ws.webservices.engine.handlers.WrappedHandler.invoke(WrappedHandler.java:64)
at
com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:225)
at
com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:225)
at com.ibm.ws.webservices.engine.WebServicesEngine.invoke(WebServicesEngine.java:279)
at
com.ibm.ws.webservices.engine.transport.http.WebServicesServlet.doPost(WebServicesServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at
com.ibm.ws.webservices.engine.transport.http.WebServicesServletBase.service(WebServicesServletBase.java:341)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1282)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:673)
at
com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:80)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1804)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:84)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:469)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:408)
at
com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:101)
at
com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:566)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:619)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:952)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1039)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
Without modifying CacheSynchronization I only get this:
WTRN0074E: Exception caught from before_completion synchronization operation:
java.lang.UnsupportedOperationException
at
org.hibernate.transaction.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter$TransactionAdapter.setRollbackOnly(WebSphereExtendedJTATransactionLookup.java:211)
at
org.hibernate.transaction.CacheSynchronization.setRollbackOnly(CacheSynchronization.java:77)
at
org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:67)
at
org.hibernate.transaction.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter$TransactionAdapter$1.invoke(WebSphereExtendedJTATransactionLookup.java:136)
at $Proxy11.beforeCompletion(Unknown Source)
at
com.ibm.ws.jtaextensions.SynchronizationCallbackWrapper.beforeCompletion(SynchronizationCallbackWrapper.java:65)
at
com.ibm.ws.Transaction.JTA.RegisteredSyncs.distributeBefore(RegisteredSyncs.java(Compiled
Code))
at com.ibm.ws.Transaction.JTA.TransactionImpl.prePrepare(TransactionImpl.java(Compiled
Code))
.....
I use these transaction settings for hibernate:
<property
name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property
name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</property>
<property
name="hibernate.transaction.flush_before_completion">true</property>
<property
name="hibernate.transaction.auto_close_session">true</property>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira