]
Steve Ebersole closed HHH-3187.
-------------------------------
Resolution: Incomplete
Issue with Hibernate3.0 and weblogic8.1 while setting transaction is
marked to setRollbackOnly... (AppSetRollbackOnlyException)
-------------------------------------------------------------------------------------------------------------------------------
Key: HHH-3187
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3187
Project: Hibernate Core
Issue Type: Task
Affects Versions: 3.0 final
Environment: hibernate3.0, weblogic8.1, oracle9.1
Reporter: Anjan Deb
Original Estimate: 13h
Remaining Estimate: 13h
I am using Hibernate 3.0 with JTA (Weblogic 8.1 SP4).
Basically, I am trying to handle transaction/hibernate exceptions in my application.
I am managing transactions with UserTransaction. I start a transaction at the begining of
the request and after that I am doing some operations on that transaction. And if some
exception comes I log it, rollback the transaction and throw the exception.
UserTransaction.commit() throws RollbackException if anything goes wrong with the
operation, but, it does not return what exactly went wrong, like, exceptions related to
SQL Exception or hibernate Exception. It basically dumps all that information to the logs
internally and throws RollbackException with the following trace (see below). But this
trace has no such information which I can send back to the user. As, information of what
went wrong has already been dumped to the server console.
I will appreciate if you can tell if there is anyway I can recieve the actual exception
trace or am I doing anything wrong with the hibernate configuration??
Thanks in Advance,
Anjan
------------------------------------------------------------------------------------------------------------------------------
Actual Exception which transaction dumps to the server console/log
ERROR - ORA-00001: unique constraint (NOVATXN.UQ_BROKERS) violated
ERROR - ORA-00001: unique constraint (NOVATXN.UQ_BROKERS) violated
ERROR - Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch
update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:69)
at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:202)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:230)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
at
org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
at
org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:980)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:353)
at
org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:59)
at
weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1010)
at
weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:115)
at
weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1216)
at
weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1990)
at
weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:275)
at
weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:246)
at
weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:303)
at
weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:296)
at
com.ebw.nova.common.invoker.JTATransactionalAction.commit(JTATransactionalAction.java:31)
at
com.ebw.nova.common.invoker.TransactionalAction.doAction(TransactionalAction.java:47)
at com.ebw.nova.common.invoker.ActionInvoker.invokeAction(ActionInvoker.java:21)
at
com.ebw.nova.server.handler.AbstractRequestHandler.process(AbstractRequestHandler.java:73)
at
com.ebw.nova.server.communication.jms.MessageProcessor.processRequest(MessageProcessor.java:44)
at com.ebw.ejb.mdb.MQManager.onMessage(MQManager.java:70)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:370)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:262)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2678)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2598)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
Caused by: java.sql.BatchUpdateException: ORA-00001: unique constraint
(NOVATXN.UQ_BROKERS) violated
at
oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:367)
at
oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:8726)
at
weblogic.jdbc.wrapper.PreparedStatement.executeBatch(PreparedStatement.java:169)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:195)
... 27 more
RollbackException Trace:
03/17/2008 08:50:09 [EROR] JTATransactionalAction
weblogic.transaction.RollbackException: Unknown reason - with nested exception:
[weblogic.transaction.internal.AppSetRollbackOnlyException]
03/17/2008 08:50:09 [EROR] JTATransactionalAction
com.novarum.nova.application.OperationException: Transaction does not exist
03/17/2008 08:50:09 [DBUG] MessageProcessor Unknown reason
java.lang.RuntimeException: Unknown reason
at
com.ebw.nova.common.invoker.TransactionalAction.doAction(TransactionalAction.java:54)
at com.ebw.nova.common.invoker.ActionInvoker.invokeAction(ActionInvoker.java:21)
at
com.ebw.nova.server.handler.AbstractRequestHandler.process(AbstractRequestHandler.java:73)
at
com.ebw.nova.server.communication.jms.MessageProcessor.processRequest(MessageProcessor.java:44)
at com.ebw.ejb.mdb.MQManager.onMessage(MQManager.java:70)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:370)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:262)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2678)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2598)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
Caused by: com.novarum.nova.application.OperationException: Unknown reason
at
com.ebw.nova.common.invoker.JTATransactionalAction.commit(JTATransactionalAction.java:35)
at
com.ebw.nova.common.invoker.TransactionalAction.doAction(TransactionalAction.java:47)
... 10 more
Caused by: weblogic.transaction.RollbackException: Unknown reason - with nested
exception:
[weblogic.transaction.internal.AppSetRollbackOnlyException]
at
weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1683)
at
weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:325)
at
weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:246)
at
weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:303)
at
weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:296)
at
com.ebw.nova.common.invoker.JTATransactionalAction.commit(JTATransactionalAction.java:31)
... 11 more
getCause(): com.novarum.nova.application.OperationException: Unknown reason
at
com.ebw.nova.common.invoker.JTATransactionalAction.commit(JTATransactionalAction.java:35)
at
com.ebw.nova.common.invoker.TransactionalAction.doAction(TransactionalAction.java:47)
at com.ebw.nova.common.invoker.ActionInvoker.invokeAction(ActionInvoker.java:21)
at
com.ebw.nova.server.handler.AbstractRequestHandler.process(AbstractRequestHandler.java:73)
at
com.ebw.nova.server.communication.jms.MessageProcessor.processRequest(MessageProcessor.java:44)
at com.ebw.ejb.mdb.MQManager.onMessage(MQManager.java:70)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:370)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:262)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2678)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2598)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
Caused by: weblogic.transaction.RollbackException: Unknown reason - with nested
exception:
[weblogic.transaction.internal.AppSetRollbackOnlyException]
at
weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1683)
at
weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:325)
at
weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:246)
at
weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:303)
at
weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:296)
at
com.ebw.nova.common.invoker.JTATransactionalAction.commit(JTATransactionalAction.java:31)
... 11 more
getCause(): weblogic.transaction.internal.AppSetRollbackOnlyException
at
weblogic.transaction.internal.TransactionImpl.setRollbackOnly(TransactionImpl.java:504)
at
org.hibernate.transaction.CacheSynchronization.setRollbackOnly(CacheSynchronization.java:73)
at
org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:63)
at
weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1010)
at
weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:115)
at
weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1216)
at
weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1990)
at
weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:275)
at
weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:246)
at
weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:303)
at
weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:296)
at
com.ebw.nova.common.invoker.JTATransactionalAction.commit(JTATransactionalAction.java:31)
at
com.ebw.nova.common.invoker.TransactionalAction.doAction(TransactionalAction.java:47)
at com.ebw.nova.common.invoker.ActionInvoker.invokeAction(ActionInvoker.java:21)
at
com.ebw.nova.server.handler.AbstractRequestHandler.process(AbstractRequestHandler.java:73)
at
com.ebw.nova.server.communication.jms.MessageProcessor.processRequest(MessageProcessor.java:44)
at com.ebw.ejb.mdb.MQManager.onMessage(MQManager.java:70)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:370)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:262)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2678)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2598)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
--------------- nested within: ------------------
weblogic.transaction.RollbackException: Unknown reason - with nested exception:
[weblogic.transaction.internal.AppSetRollbackOnlyException]
at
weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1683)
at
weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:325)
at
weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:246)
at
weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:303)
at
weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:296)
at
com.ebw.nova.common.invoker.JTATransactionalAction.commit(JTATransactionalAction.java:31)
at
com.ebw.nova.common.invoker.TransactionalAction.doAction(TransactionalAction.java:47)
at com.ebw.nova.common.invoker.ActionInvoker.invokeAction(ActionInvoker.java:21)
at
com.ebw.nova.server.handler.AbstractRequestHandler.process(AbstractRequestHandler.java:73)
at
com.ebw.nova.server.communication.jms.MessageProcessor.processRequest(MessageProcessor.java:44)
at com.ebw.ejb.mdb.MQManager.onMessage(MQManager.java:70)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:370)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:262)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2678)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2598)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
getNested(): weblogic.transaction.internal.AppSetRollbackOnlyException
at
weblogic.transaction.internal.TransactionImpl.setRollbackOnly(TransactionImpl.java:504)
at
org.hibernate.transaction.CacheSynchronization.setRollbackOnly(CacheSynchronization.java:73)
at
org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:63)
at
weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1010)
at
weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:115)
at
weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1216)
at
weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1990)
at
weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:275)
at
weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:246)
at
weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:303)
at
weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:296)
at
com.ebw.nova.common.invoker.JTATransactionalAction.commit(JTATransactionalAction.java:31)
at
com.ebw.nova.common.invoker.TransactionalAction.doAction(TransactionalAction.java:47)
at com.ebw.nova.common.invoker.ActionInvoker.invokeAction(ActionInvoker.java:21)
at
com.ebw.nova.server.handler.AbstractRequestHandler.process(AbstractRequestHandler.java:73)
at
com.ebw.nova.server.communication.jms.MessageProcessor.processRequest(MessageProcessor.java:44)
at com.ebw.ejb.mdb.MQManager.onMessage(MQManager.java:70)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:370)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:262)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2678)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2598)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
Following is the hibernate.cfg.xml
<session-factory>
<!-- properties -->
<property
name="connection.datasource">jdbc/novaJDBCDataSource</property>
<property
name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property
name="transaction.manager_lookup_class">org.hibernate.transaction.WeblogicTransactionManagerLookup</property>
<property
name="dialect">org.hibernate.dialect.OracleDialect</property>
<property name="current_session_context_class">jta</property>
<property name="show_sql">false</property>
<property name="format_sql">true</property>
<property name="hibernate.default_schema">novatxn</property>
<property name="jdbc.batch_size">30</property>
<!-- jdbc.batch_versioned_data is set to false, making it true hibernate doesn't
raise optimistic exception. -->
<property name="jdbc.batch_versioned_data">false</property>
<property name="jdbc.use_streams_for_binary">true</property>
<!-- Outer join fetching is used in MultiDArray-->
<property name="max_fetch_depth">1</property>
<property name="query.substitutions">true 1, false 0, yes 'Y', no
'N'</property>
<!--property
name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property-->
<!--#Using the Hibernate 2.1 query parser, because of Weblogic 8.1 ANTLR issue.-->
<property
name="query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
</session-factory>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: