PDA

View Full Version : Dealing with CMT Rollback exceptions to get "REAL"


Loumeister
Aug 18th, 2004, 02:20 PM
After switching to the session-per-transaction idiom using CMT SLSBs, I have run into a situation when the session flushes and it thows an exception. Because CMT transaction commit controls the session being flushed and if an exception is thrown here, the transaction simply rollsback. All I get in the catch block is that there was a Rollback exception and not the real exception until I look at the logs. I try to drill down into the exception hierarchy, but I don't see the SQL exception. I really need to return the "real" exception. I included what I'm seeing in the logs.

Any strategies for handling this?

Thanks,
Lou

10:31:44,146 DEBUG SessionFactoryUtils:404 - Flushing Hibernate session on transaction synchronization
10:31:44,568 WARN JDBCExceptionReporter:38 - SQL Error: 1401, SQLState: 23000
10:31:44,584 ERROR JDBCExceptionReporter:46 - ORA-01401: inserted value too large for column

10:31:44,584 ERROR JDBCExceptionReporter:38 - could not insert: [com.mitchell.services.technical.claim.dao.vo.ClmC laimVehicle#123]
java.sql.SQLException: ORA-01401: inserted value too large for column

at oracle.jdbc.driver.DatabaseError.throwSqlException (DatabaseError.java:125)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoe r.java:305)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoe r.java:272)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java: 623)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4 CPreparedStatement.java:181)
at oracle.jdbc.driver.T4CPreparedStatement.execute_fo r_rows(T4CPreparedStatement.java:543)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTi meout(OracleStatement.java:1027)
at oracle.jdbc.driver.OraclePreparedStatement.execute Internal(OraclePreparedStatement.java:2885)
at oracle.jdbc.driver.OraclePreparedStatement.execute Update(OraclePreparedStatement.java:2957)
at weblogic.jdbc.wrapper.PreparedStatement.executeUpd ate(PreparedStatement.java:115)
at net.sf.hibernate.impl.NonBatchingBatcher.addToBatc h(NonBatchingBatcher.java:22)
at net.sf.hibernate.persister.EntityPersister.insert( EntityPersister.java:468)
at net.sf.hibernate.persister.EntityPersister.insert( EntityPersister.java:442)
at net.sf.hibernate.impl.ScheduledInsertion.execute(S cheduledInsertion.java:29)
at net.sf.hibernate.impl.SessionImpl.executeAll(Sessi onImpl.java:2414)
at net.sf.hibernate.impl.SessionImpl.execute(SessionI mpl.java:2367)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImp l.java:2236)
at org.springframework.orm.hibernate.SessionFactoryUt ils$SpringSessionSynchronization.beforeCommit(Sess ionFactoryUtils.java:406)
at org.springframework.orm.hibernate.SessionFactoryUt ils$JtaSessionSynchronization.beforeCompletion(Ses sionFactoryUtils.java:470)
at weblogic.transaction.internal.ServerSCInfo.callBef oreCompletions(ServerSCInfo.java:1010)
at weblogic.transaction.internal.ServerSCInfo.startPr ePrepareAndChain(ServerSCInfo.java:115)
at weblogic.transaction.internal.ServerTransactionImp l.localPrePrepareAndChain(ServerTransactionImpl.ja va:1184)
at weblogic.transaction.internal.ServerTransactionImp l.globalPrePrepare(ServerTransactionImpl.java:1910 )
at weblogic.transaction.internal.ServerTransactionImp l.internalCommit(ServerTransactionImpl.java:273)
at weblogic.transaction.internal.ServerTransactionImp l.commit(ServerTransactionImpl.java:244)
at weblogic.ejb20.internal.BaseEJBLocalObject.postInv oke(BaseEJBLocalObject.java:363)
at com.mitchell.services.technical.claim.ejb.ClaimBea n_jpstj4_ELOImpl.saveExposure(ClaimBean_jpstj4_ELO Impl.java:627)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.bea.wlw.runtime.core.control.EJBControlImpl.in voke(EJBControlImpl.jcs:607)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.inv oke(DispMethod.java:373)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:423)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:396)
at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke( JcsProxy.java:388)
at $Proxy43.saveExposure(Unknown Source)
at com.mitchell.services.technical.claim.process.Clai mProcess.myEJBControlSaveExposure(ClaimProcess.jpd :758)
at com.mitchell.services.technical.claim.process.Clai mProcess_wf$ImplControlSend25.invoke(ClaimProcess_ wf.java:233)
at com.bea.wli.bpm.runtime.Perform.execute(Perform.ja va:32)
at com.bea.wli.bpm.runtime.SyncReceive.messageDeliver y(SyncReceive.java:45)
at com.bea.wli.bpm.runtime.Receive.messageDeliveryAct ion(Receive.java:71)
at com.bea.wli.bpm.runtime.ProcessState.processMessag e(ProcessState.java:166)
at com.mitchell.services.technical.claim.process.Clai mProcess_wf$_ProcessState.processMessage(ClaimProc ess_wf.java:907)
at com.mitchell.services.technical.claim.process.Clai mProcess_wf.$__saveExposure(ClaimProcess_wf.java:8 17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.inv oke(DispMethod.java:367)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:423)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:396)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:248)
at com.bea.wlw.runtime.core.bean.BaseContainerBean.in vokeBase(BaseContainerBean.java:198)
at com.bea.wlw.runtime.core.bean.SLSBContainerBean.in voke(SLSBContainerBean.java:103)
at com.bea.wlwgen.ClaimProcessSLSBContImpl.saveExposu re(ClaimProcessSLSBContImpl.java:140)
at com.bea.wlwgen.StatelessContainer_van0w4_ELOImpl.s aveExposure(StatelessContainer_van0w4_ELOImpl.java :639)
at com.bea.wlwgen.ClaimProcessSLSBContAdpt.invokeOnBe an(ClaimProcessSLSBContAdpt.java:126)
at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.r unAsInvoke(BaseDispatcherBean.java:153)
at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.i nvoke(BaseDispatcherBean.java:54)
at com.bea.wlw.runtime.core.bean.SyncDispatcherBean.i nvoke(SyncDispatcherBean.java:160)
at com.bea.wlw.runtime.core.bean.SyncDispatcher_k1mrl 8_EOImpl.invoke(SyncDispatcher_k1mrl8_EOImpl.java: 46)
at com.bea.wlw.runtime.core.dispatcher.Dispatcher.rem oteDispatch(Dispatcher.java:161)
at com.bea.wlw.runtime.core.dispatcher.ServiceHandleI mpl.invoke(ServiceHandleImpl.java:436)
at com.bea.wlw.runtime.core.call.JavaCall.invoke(Java Call.java:55)
at com.bea.wli.bpm.runtime.SubFlowCall.invoke(SubFlow Call.java:108)
at com.bea.wlw.runtime.core.control.ServiceControlImp l.invoke(ServiceControlImpl.jcs:1257)
at com.bea.control.ProcessControlImpl.invoke(ProcessC ontrolImpl.jcs:443)
at com.bea.wlw.runtime.core.control.ServiceControlImp l.invoke(ServiceControlImpl.jcs:1123)
at com.bea.control.ProcessControlImpl.invoke(ProcessC ontrolImpl.jcs:379)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.inv oke(DispMethod.java:373)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:423)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:396)
at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke( JcsProxy.java:388)
at $Proxy41.saveExposure(Unknown Source)
at com.mitchell.services.technical.claim.process.Clai mProcessPControlTest.saveExposure(ClaimProcessPCon trolTest.jws:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.inv oke(DispMethod.java:367)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:423)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:396)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:248)
at com.bea.wlw.runtime.core.bean.BaseContainerBean.in vokeBase(BaseContainerBean.java:198)
at com.bea.wlw.runtime.core.bean.SLSBContainerBean.in voke(SLSBContainerBean.java:103)
at com.bea.wlwgen.ClaimProcessPControlTestSLSBContImp l.saveExposure(ClaimProcessPControlTestSLSBContImp l.java:55)
at com.bea.wlwgen.StatelessContainer_a4brx9_ELOImpl.s aveExposure(StatelessContainer_a4brx9_ELOImpl.java :315)
at com.bea.wlwgen.ClaimProcessPControlTestSLSBContAdp t.invokeOnBean(ClaimProcessPControlTestSLSBContAdp t.java:78)
at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.r unAsInvoke(BaseDispatcherBean.java:153)
at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.i nvoke(BaseDispatcherBean.java:54)
at com.bea.wlw.runtime.core.bean.SyncDispatcherBean.i nvoke(SyncDispatcherBean.java:160)
at com.bea.wlw.runtime.core.bean.SyncDispatcher_k1mrl 8_EOImpl.invoke(SyncDispatcher_k1mrl8_EOImpl.java: 46)
at com.bea.wlw.runtime.core.dispatcher.Dispatcher.rem oteDispatch(Dispatcher.java:161)
at com.bea.wlw.runtime.core.dispatcher.Dispatcher.dis patch(Dispatcher.java:49)
at com.bea.wlw.runtime.core.dispatcher.HttpServerHelp er.executePostRequest(HttpServerHelper.java:713)
at com.bea.wlw.runtime.core.dispatcher.HttpServer.doP ost(HttpServer.java:49)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletI nvocationAction.run(ServletStubImpl.java:996)
at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java:419)
at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java:315)
at weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationAction.run(WebAppServletContext.java :6452)
at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.inv okeServlet(WebAppServletContext.java:3661)
at weblogic.servlet.internal.ServletRequestImpl.execu te(ServletRequestImpl.java:2630)
at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:178)
10:31:44,631 ERROR SessionImpl:2375 - Could not synchronize database state with session
net.sf.hibernate.JDBCException: could not insert: [com.mitchell.services.technical.claim.dao.vo.ClmC laimVehicle#123]
at net.sf.hibernate.persister.EntityPersister.insert( EntityPersister.java:478)
at net.sf.hibernate.persister.EntityPersister.insert( EntityPersister.java:442)
at net.sf.hibernate.impl.ScheduledInsertion.execute(S cheduledInsertion.java:29)
at net.sf.hibernate.impl.SessionImpl.executeAll(Sessi onImpl.java:2414)
at net.sf.hibernate.impl.SessionImpl.execute(SessionI mpl.java:2367)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImp l.java:2236)
at org.springframework.orm.hibernate.SessionFactoryUt ils$SpringSessionSynchronization.beforeCommit(Sess ionFactoryUtils.java:406)
at org.springframework.orm.hibernate.SessionFactoryUt ils$JtaSessionSynchronization.beforeCompletion(Ses sionFactoryUtils.java:470)
at weblogic.transaction.internal.ServerSCInfo.callBef oreCompletions(ServerSCInfo.java:1010)
at weblogic.transaction.internal.ServerSCInfo.startPr ePrepareAndChain(ServerSCInfo.java:115)
at weblogic.transaction.internal.ServerTransactionImp l.localPrePrepareAndChain(ServerTransactionImpl.ja va:1184)
at weblogic.transaction.internal.ServerTransactionImp l.globalPrePrepare(ServerTransactionImpl.java:1910 )
at weblogic.transaction.internal.ServerTransactionImp l.internalCommit(ServerTransactionImpl.java:273)
at weblogic.transaction.internal.ServerTransactionImp l.commit(ServerTransactionImpl.java:244)
at weblogic.ejb20.internal.BaseEJBLocalObject.postInv oke(BaseEJBLocalObject.java:363)
at com.mitchell.services.technical.claim.ejb.ClaimBea n_jpstj4_ELOImpl.saveExposure(ClaimBean_jpstj4_ELO Impl.java:627)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.bea.wlw.runtime.core.control.EJBControlImpl.in voke(EJBControlImpl.jcs:607)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.inv oke(DispMethod.java:373)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:423)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:396)
at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke( JcsProxy.java:388)
at $Proxy43.saveExposure(Unknown Source)
at com.mitchell.services.technical.claim.process.Clai mProcess.myEJBControlSaveExposure(ClaimProcess.jpd :758)
at com.mitchell.services.technical.claim.process.Clai mProcess_wf$ImplControlSend25.invoke(ClaimProcess_ wf.java:233)
at com.bea.wli.bpm.runtime.Perform.execute(Perform.ja va:32)
at com.bea.wli.bpm.runtime.SyncReceive.messageDeliver y(SyncReceive.java:45)
at com.bea.wli.bpm.runtime.Receive.messageDeliveryAct ion(Receive.java:71)
at com.bea.wli.bpm.runtime.ProcessState.processMessag e(ProcessState.java:166)
at com.mitchell.services.technical.claim.process.Clai mProcess_wf$_ProcessState.processMessage(ClaimProc ess_wf.java:907)
at com.mitchell.services.technical.claim.process.Clai mProcess_wf.$__saveExposure(ClaimProcess_wf.java:8 17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.inv oke(DispMethod.java:367)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:423)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:396)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:248)
at com.bea.wlw.runtime.core.bean.BaseContainerBean.in vokeBase(BaseContainerBean.java:198)
at com.bea.wlw.runtime.core.bean.SLSBContainerBean.in voke(SLSBContainerBean.java:103)
at com.bea.wlwgen.ClaimProcessSLSBContImpl.saveExposu re(ClaimProcessSLSBContImpl.java:140)
at com.bea.wlwgen.StatelessContainer_van0w4_ELOImpl.s aveExposure(StatelessContainer_van0w4_ELOImpl.java :639)
at com.bea.wlwgen.ClaimProcessSLSBContAdpt.invokeOnBe an(ClaimProcessSLSBContAdpt.java:126)
at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.r unAsInvoke(BaseDispatcherBean.java:153)
at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.i nvoke(BaseDispatcherBean.java:54)
at com.bea.wlw.runtime.core.bean.SyncDispatcherBean.i nvoke(SyncDispatcherBean.java:160)
at com.bea.wlw.runtime.core.bean.SyncDispatcher_k1mrl 8_EOImpl.invoke(SyncDispatcher_k1mrl8_EOImpl.java: 46)
at com.bea.wlw.runtime.core.dispatcher.Dispatcher.rem oteDispatch(Dispatcher.java:161)
at com.bea.wlw.runtime.core.dispatcher.ServiceHandleI mpl.invoke(ServiceHandleImpl.java:436)
at com.bea.wlw.runtime.core.call.JavaCall.invoke(Java Call.java:55)
at com.bea.wli.bpm.runtime.SubFlowCall.invoke(SubFlow Call.java:108)
at com.bea.wlw.runtime.core.control.ServiceControlImp l.invoke(ServiceControlImpl.jcs:1257)
at com.bea.control.ProcessControlImpl.invoke(ProcessC ontrolImpl.jcs:443)
at com.bea.wlw.runtime.core.control.ServiceControlImp l.invoke(ServiceControlImpl.jcs:1123)
at com.bea.control.ProcessControlImpl.invoke(ProcessC ontrolImpl.jcs:379)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.inv oke(DispMethod.java:373)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:423)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:396)
at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke( JcsProxy.java:388)
at $Proxy41.saveExposure(Unknown Source)
at com.mitchell.services.technical.claim.process.Clai mProcessPControlTest.saveExposure(ClaimProcessPCon trolTest.jws:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.inv oke(DispMethod.java:367)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:423)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:396)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:248)
at com.bea.wlw.runtime.core.bean.BaseContainerBean.in vokeBase(BaseContainerBean.java:198)
at com.bea.wlw.runtime.core.bean.SLSBContainerBean.in voke(SLSBContainerBean.java:103)
at com.bea.wlwgen.ClaimProcessPControlTestSLSBContImp l.saveExposure(ClaimProcessPControlTestSLSBContImp l.java:55)
at com.bea.wlwgen.StatelessContainer_a4brx9_ELOImpl.s aveExposure(StatelessContainer_a4brx9_ELOImpl.java :315)
at com.bea.wlwgen.ClaimProcessPControlTestSLSBContAdp t.invokeOnBean(ClaimProcessPControlTestSLSBContAdp t.java:78)
at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.r unAsInvoke(BaseDispatcherBean.java:153)
at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.i nvoke(BaseDispatcherBean.java:54)
at com.bea.wlw.runtime.core.bean.SyncDispatcherBean.i nvoke(SyncDispatcherBean.java:160)
at com.bea.wlw.runtime.core.bean.SyncDispatcher_k1mrl 8_EOImpl.invoke(SyncDispatcher_k1mrl8_EOImpl.java: 46)
at com.bea.wlw.runtime.core.dispatcher.Dispatcher.rem oteDispatch(Dispatcher.java:161)
at com.bea.wlw.runtime.core.dispatcher.Dispatcher.dis patch(Dispatcher.java:49)
at com.bea.wlw.runtime.core.dispatcher.HttpServerHelp er.executePostRequest(HttpServerHelper.java:713)
at com.bea.wlw.runtime.core.dispatcher.HttpServer.doP ost(HttpServer.java:49)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletI nvocationAction.run(ServletStubImpl.java:996)
at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java:419)
at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java:315)
at weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationAction.run(WebAppServletContext.java :6452)
at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.inv okeServlet(WebAppServletContext.java:3661)
at weblogic.servlet.internal.ServletRequestImpl.execu te(ServletRequestImpl.java:2630)
at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:178)
Caused by: java.sql.SQLException: ORA-01401: inserted value too large for column

at oracle.jdbc.driver.DatabaseError.throwSqlException (DatabaseError.java:125)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoe r.java:305)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoe r.java:272)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java: 623)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4 CPreparedStatement.java:181)
at oracle.jdbc.driver.T4CPreparedStatement.execute_fo r_rows(T4CPreparedStatement.java:543)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTi meout(OracleStatement.java:1027)
at oracle.jdbc.driver.OraclePreparedStatement.execute Internal(OraclePreparedStatement.java:2885)
at oracle.jdbc.driver.OraclePreparedStatement.execute Update(OraclePreparedStatement.java:2957)
at weblogic.jdbc.wrapper.PreparedStatement.executeUpd ate(PreparedStatement.java:115)
at net.sf.hibernate.impl.NonBatchingBatcher.addToBatc h(NonBatchingBatcher.java:22)
at net.sf.hibernate.persister.EntityPersister.insert( EntityPersister.java:468)
... 97 more
10:31:44,709 INFO SQLStateSQLExceptionTranslator:64 - Translating SQLException with SQLState '23000' and errorCode '1401' and message [ORA-01401: inserted value too large for column
]; SQL was [null] for task [SessionSynchronization]
10:31:44,740 ERROR SessionFactoryUtils:473 - beforeCommit callback threw exception
org.springframework.dao.DataIntegrityViolationExce ption: (SessionSynchronization): data integrity violated by SQL 'null'; nested exception is java.sql.SQLException: ORA-01401: inserted value too large for column

10:31:44,787 DEBUG TransactionSynchronizationManager:163 - Removed value [org.springframework.orm.hibernate.SessionHolder@1 f0cbb9] for key [net.sf.hibernate.impl.SessionFactoryImpl@42337 6] from thread [ExecuteThread: '6' for queue: 'weblogic.kernel.Default']
10:31:44,802 DEBUG SessionFactoryUtils:348 - Closing Hibernate session
10:31:45,068 DEBUG Invocable:41 - Sending context event onException to myEJBControl
10:31:45,084 DEBUG DispClass:41 - getDispControl context on class com.bea.wlw.runtime.core.control.SessionEJBControl Impl
10:31:45,099 DEBUG WlwThreadContext:41 - startInvocation on myEJBControl:context: weblogic.jws.control.Context$Callback.onException( )
10:31:45,099 INFO Claim:43 - ConversationID=172.24.171.49-10bb37b.fe72e73166.-7feb; TopLevelClass=com.mitchell.services.technical.clai m.process.ClaimProcess_wf; Id=myEJBControl:context; Method=weblogic.jws.control.Context$Callback.onExc eption()
10:31:45,115 DEBUG Claim:41 - Id=myEJBControl:context; Method=weblogic.jws.control.Context$Callback.onExc eption(); Principals=null; Params=["javax.ejb.TransactionRolledbackLocalException: Error committing transaction:; nested exception is: weblogic.transaction.internal.AppSetRollbackOnlyEx ception", "saveExposure", "[Ljava.lang.Object;@a6118"]
10:31:45,115 DEBUG DispClass:41 - getDispControl context on class com.bea.wlw.runtime.core.control.SessionEJBControl Impl
10:31:45,131 DEBUG Invocable:41 - Invoking onException on target object: com.bea.wlw.runtime.jcs.container.JcsContainer{com .bea.wlw.runtime.core.control.SessionEJBControlImp l}[com.bea.wlw.runtime.core.control.SessionEJBCont rolImpl@caf1a0]
10:31:45,177 DEBUG Container:42 - onException event: saveExposure

Throwable: javax.ejb.TransactionRolledbackLocalException: Error committing transaction:; nested exception is: weblogic.transaction.internal.AppSetRollbackOnlyEx ception
Stack Trace:
javax.ejb.TransactionRolledbackLocalException: Error committing transaction:; nested exception is: weblogic.transaction.internal.AppSetRollbackOnlyEx ception
weblogic.transaction.internal.AppSetRollbackOnlyEx ception
at weblogic.transaction.internal.TransactionImpl.setR ollbackOnly(TransactionImpl.java:504)
at weblogic.transaction.internal.TransactionManagerIm pl.setRollbackOnly(TransactionManagerImpl.java:337 )
at weblogic.transaction.internal.TransactionManagerIm pl.setRollbackOnly(TransactionManagerImpl.java:331 )
at org.springframework.orm.hibernate.SessionFactoryUt ils$JtaSessionSynchronization.beforeCompletion(Ses sionFactoryUtils.java:475)
at weblogic.transaction.internal.ServerSCInfo.callBef oreCompletions(ServerSCInfo.java:1010)
at weblogic.transaction.internal.ServerSCInfo.startPr ePrepareAndChain(ServerSCInfo.java:115)
at weblogic.transaction.internal.ServerTransactionImp l.localPrePrepareAndChain(ServerTransactionImpl.ja va:1184)
at weblogic.transaction.internal.ServerTransactionImp l.globalPrePrepare(ServerTransactionImpl.java:1910 )
at weblogic.transaction.internal.ServerTransactionImp l.internalCommit(ServerTransactionImpl.java:273)
at weblogic.transaction.internal.ServerTransactionImp l.commit(ServerTransactionImpl.java:244)
at weblogic.ejb20.internal.BaseEJBLocalObject.postInv oke(BaseEJBLocalObject.java:363)
at com.mitchell.services.technical.claim.ejb.ClaimBea n_jpstj4_ELOImpl.saveExposure(ClaimBean_jpstj4_ELO Impl.java:627)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.bea.wlw.runtime.core.control.EJBControlImpl.in voke(EJBControlImpl.jcs:607)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.inv oke(DispMethod.java:373)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:423)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:396)
at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke( JcsProxy.java:388)
at $Proxy43.saveExposure(Unknown Source)
at com.mitchell.services.technical.claim.process.Clai mProcess.myEJBControlSaveExposure(ClaimProcess.jpd :758)
at com.mitchell.services.technical.claim.process.Clai mProcess_wf$ImplControlSend25.invoke(ClaimProcess_ wf.java:233)
at com.bea.wli.bpm.runtime.Perform.execute(Perform.ja va:32)
at com.bea.wli.bpm.runtime.SyncReceive.messageDeliver y(SyncReceive.java:45)
at com.bea.wli.bpm.runtime.Receive.messageDeliveryAct ion(Receive.java:71)
at com.bea.wli.bpm.runtime.ProcessState.processMessag e(ProcessState.java:166)
at com.mitchell.services.technical.claim.process.Clai mProcess_wf$_ProcessState.processMessage(ClaimProc ess_wf.java:907)
at com.mitchell.services.technical.claim.process.Clai mProcess_wf.$__saveExposure(ClaimProcess_wf.java:8 17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.inv oke(DispMethod.java:367)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:423)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:396)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:248)
at com.bea.wlw.runtime.core.bean.BaseContainerBean.in vokeBase(BaseContainerBean.java:198)
at com.bea.wlw.runtime.core.bean.SLSBContainerBean.in voke(SLSBContainerBean.java:103)
at com.bea.wlwgen.ClaimProcessSLSBContImpl.saveExposu re(ClaimProcessSLSBContImpl.java:140)
at com.bea.wlwgen.StatelessContainer_van0w4_ELOImpl.s aveExposure(StatelessContainer_van0w4_ELOImpl.java :639)
at com.bea.wlwgen.ClaimProcessSLSBContAdpt.invokeOnBe an(ClaimProcessSLSBContAdpt.java:126)
at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.r unAsInvoke(BaseDispatcherBean.java:153)
at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.i nvoke(BaseDispatcherBean.java:54)
at com.bea.wlw.runtime.core.bean.SyncDispatcherBean.i nvoke(SyncDispatcherBean.java:160)
at com.bea.wlw.runtime.core.bean.SyncDispatcher_k1mrl 8_EOImpl.invoke(SyncDispatcher_k1mrl8_EOImpl.java: 46)
at com.bea.wlw.runtime.core.dispatcher.Dispatcher.rem oteDispatch(Dispatcher.java:161)
at com.bea.wlw.runtime.core.dispatcher.ServiceHandleI mpl.invoke(ServiceHandleImpl.java:436)
at com.bea.wlw.runtime.core.call.JavaCall.invoke(Java Call.java:55)
at com.bea.wli.bpm.runtime.SubFlowCall.invoke(SubFlow Call.java:108)
at com.bea.wlw.runtime.core.control.ServiceControlImp l.invoke(ServiceControlImpl.jcs:1257)
at com.bea.control.ProcessControlImpl.invoke(ProcessC ontrolImpl.jcs:443)
at com.bea.wlw.runtime.core.control.ServiceControlImp l.invoke(ServiceControlImpl.jcs:1123)
at com.bea.control.ProcessControlImpl.invoke(ProcessC ontrolImpl.jcs:379)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.inv oke(DispMethod.java:373)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:423)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:396)
at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke( JcsProxy.java:388)
at $Proxy41.saveExposure(Unknown Source)
at com.mitchell.services.technical.claim.process.Clai mProcessPControlTest.saveExposure(ClaimProcessPCon trolTest.jws:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.inv oke(DispMethod.java:367)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:423)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:396)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:248)
at com.bea.wlw.runtime.core.bean.BaseContainerBean.in vokeBase(BaseContainerBean.java:198)
at com.bea.wlw.runtime.core.bean.SLSBContainerBean.in voke(SLSBContainerBean.java:103)
at com.bea.wlwgen.ClaimProcessPControlTestSLSBContImp l.saveExposure(ClaimProcessPControlTestSLSBContImp l.java:55)
at com.bea.wlwgen.StatelessContainer_a4brx9_ELOImpl.s aveExposure(StatelessContainer_a4brx9_ELOImpl.java :315)
at com.bea.wlwgen.ClaimProcessPControlTestSLSBContAdp t.invokeOnBean(ClaimProcessPControlTestSLSBContAdp t.java:78)
at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.r unAsInvoke(BaseDispatcherBean.java:153)
at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.i nvoke(BaseDispatcherBean.java:54)
at com.bea.wlw.runtime.core.bean.SyncDispatcherBean.i nvoke(SyncDispatcherBean.java:160)
at com.bea.wlw.runtime.core.bean.SyncDispatcher_k1mrl 8_EOImpl.invoke(SyncDispatcher_k1mrl8_EOImpl.java: 46)
at com.bea.wlw.runtime.core.dispatcher.Dispatcher.rem oteDispatch(Dispatcher.java:161)
at com.bea.wlw.runtime.core.dispatcher.Dispatcher.dis patch(Dispatcher.java:49)
at com.bea.wlw.runtime.core.dispatcher.HttpServerHelp er.executePostRequest(HttpServerHelper.java:713)
at com.bea.wlw.runtime.core.dispatcher.HttpServer.doP ost(HttpServer.java:49)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletI nvocationAction.run(ServletStubImpl.java:996)
at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java:419)
at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java:315)
at weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationAction.run(WebAppServletContext.java :6452)
at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.inv okeServlet(WebAppServletContext.java:3661)
at weblogic.servlet.internal.ServletRequestImpl.execu te(ServletRequestImpl.java:2630)
at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:178)
javax.ejb.TransactionRolledbackLocalException: Error committing transaction:; nested exception is: weblogic.transaction.internal.AppSetRollbackOnlyEx ception
at weblogic.ejb20.internal.EJBRuntimeUtils.throwTrans actionRolledbackLocal(EJBRuntimeUtils.java:247)
at weblogic.ejb20.internal.EJBRuntimeUtils.throwEJBEx ception(EJBRuntimeUtils.java:133)
at weblogic.ejb20.internal.BaseEJBLocalObject.postInv oke(BaseEJBLocalObject.java:381)
at com.mitchell.services.technical.claim.ejb.ClaimBea n_jpstj4_ELOImpl.saveExposure(ClaimBean_jpstj4_ELO Impl.java:627)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.bea.wlw.runtime.core.control.EJBControlImpl.in voke(EJBControlImpl.jcs:607)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.inv oke(DispMethod.java:373)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:423)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:396)
at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke( JcsProxy.java:388)
at $Proxy43.saveExposure(Unknown Source)
at com.mitchell.services.technical.claim.process.Clai mProcess.myEJBControlSaveExposure(ClaimProcess.jpd :758)
at com.mitchell.services.technical.claim.process.Clai mProcess_wf$ImplControlSend25.invoke(ClaimProcess_ wf.java:233)
at com.bea.wli.bpm.runtime.Perform.execute(Perform.ja va:32)
at com.bea.wli.bpm.runtime.SyncReceive.messageDeliver y(SyncReceive.java:45)
at com.bea.wli.bpm.runtime.Receive.messageDeliveryAct ion(Receive.java:71)
at com.bea.wli.bpm.runtime.ProcessState.processMessag e(ProcessState.java:166)
at com.mitchell.services.technical.claim.process.Clai mProcess_wf$_ProcessState.processMessage(ClaimProc ess_wf.java:907)
at com.mitchell.services.technical.claim.process.Clai mProcess_wf.$__saveExposure(ClaimProcess_wf.java:8 17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.inv oke(DispMethod.java:367)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:423)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:396)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:248)
at com.bea.wlw.runtime.core.bean.BaseContainerBean.in vokeBase(BaseContainerBean.java:198)
at com.bea.wlw.runtime.core.bean.SLSBContainerBean.in voke(SLSBContainerBean.java:103)
at com.bea.wlwgen.ClaimProcessSLSBContImpl.saveExposu re(ClaimProcessSLSBContImpl.java:140)
at com.bea.wlwgen.StatelessContainer_van0w4_ELOImpl.s aveExposure(StatelessContainer_van0w4_ELOImpl.java :639)
at com.bea.wlwgen.ClaimProcessSLSBContAdpt.invokeOnBe an(ClaimProcessSLSBContAdpt.java:126)
at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.r unAsInvoke(BaseDispatcherBean.java:153)
at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.i nvoke(BaseDispatcherBean.java:54)
at com.bea.wlw.runtime.core.bean.SyncDispatcherBean.i nvoke(SyncDispatcherBean.java:160)
at com.bea.wlw.runtime.core.bean.SyncDispatcher_k1mrl 8_EOImpl.invoke(SyncDispatcher_k1mrl8_EOImpl.java: 46)
at com.bea.wlw.runtime.core.dispatcher.Dispatcher.rem oteDispatch(Dispatcher.java:161)
at com.bea.wlw.runtime.core.dispatcher.ServiceHandleI mpl.invoke(ServiceHandleImpl.java:436)
at com.bea.wlw.runtime.core.call.JavaCall.invoke(Java Call.java:55)
at com.bea.wli.bpm.runtime.SubFlowCall.invoke(SubFlow Call.java:108)
at com.bea.wlw.runtime.core.control.ServiceControlImp l.invoke(ServiceControlImpl.jcs:1257)
at com.bea.control.ProcessControlImpl.invoke(ProcessC ontrolImpl.jcs:443)
at com.bea.wlw.runtime.core.control.ServiceControlImp l.invoke(ServiceControlImpl.jcs:1123)
at com.bea.control.ProcessControlImpl.invoke(ProcessC ontrolImpl.jcs:379)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.inv oke(DispMethod.java:373)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:423)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:396)
at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke( JcsProxy.java:388)
at $Proxy41.saveExposure(Unknown Source)
at com.mitchell.services.technical.claim.process.Clai mProcessPControlTest.saveExposure(ClaimProcessPCon trolTest.jws:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.inv oke(DispMethod.java:367)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:423)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:396)
at com.bea.wlw.runtime.core.container.Invocable.invok e(Invocable.java:248)
at com.bea.wlw.runtime.core.bean.BaseContainerBean.in vokeBase(BaseContainerBean.java:198)
at com.bea.wlw.runtime.core.bean.SLSBContainerBean.in voke(SLSBContainerBean.java:103)
at com.bea.wlwgen.ClaimProcessPControlTestSLSBContImp l.saveExposure(ClaimProcessPControlTestSLSBContImp l.java:55)
at com.bea.wlwgen.StatelessContainer_a4brx9_ELOImpl.s aveExposure(StatelessContainer_a4brx9_ELOImpl.java :315)
at com.bea.wlwgen.ClaimProcessPControlTestSLSBContAdp t.invokeOnBean(ClaimProcessPControlTestSLSBContAdp t.java:78)
at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.r unAsInvoke(BaseDispatcherBean.java:153)
at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.i nvoke(BaseDispatcherBean.java:54)
at com.bea.wlw.runtime.core.bean.SyncDispatcherBean.i nvoke(SyncDispatcherBean.java:160)
at com.bea.wlw.runtime.core.bean.SyncDispatcher_k1mrl 8_EOImpl.invoke(SyncDispatcher_k1mrl8_EOImpl.java: 46)
at com.bea.wlw.runtime.core.dispatcher.Dispatcher.rem oteDispatch(Dispatcher.java:161)
at com.bea.wlw.runtime.core.dispatcher.Dispatcher.dis patch(Dispatcher.java:49)
at com.bea.wlw.runtime.core.dispatcher.HttpServerHelp er.executePostRequest(HttpServerHelper.java:713)
at com.bea.wlw.runtime.core.dispatcher.HttpServer.doP ost(HttpServer.java:49)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletI nvocationAction.run(ServletStubImpl.java:996)
at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java:419)
at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java:315)
at weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationAction.run(WebAppServletContext.java :6452)
at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.inv okeServlet(WebAppServletContext.java:3661)
at weblogic.servlet.internal.ServletRequestImpl.execu te(ServletRequestImpl.java:2630)
at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:178)

Colin Sampaleanu
Aug 18th, 2004, 05:09 PM
Lou,

Unfortunately unless I'm missing something, this is not really a Spring issue, but rather a function of your actual setup and how WebLogic handles runtime exceptions thrown by code inside an EJB. With the setup as you have it, there's nothing that Spring can do but throw a RuntimeException, which the container will handle as it wants to (and according to the EJB spec).

Now one approach, which is not incredibly clean, is for you yourself to just wrap the entire EJB method call in a try/catch block for DataAcessException, and using some sort of helper method, force a flush at the end of the method call. This would allow you to catch errors and perhaps map them to something else. The thing is that you do still want to force the CMT transaction to fail, so you really need to thrown a RuntimeException based exception anyways.

Colin

Loumeister
Aug 19th, 2004, 03:09 AM
Now one approach, which is not incredibly clean, is for you yourself to just wrap the entire EJB method call in a try/catch block for DataAcessException, and using some sort of helper method, force a flush at the end of the method call. This would allow you to catch errors and perhaps map them to something else. The thing is that you do still want to force the CMT transaction to fail, so you really need to thrown a RuntimeException based exception anyways.

Colin,

This is kind of where I was thinking about going with this too (so much for clean) . :? Unfortunately, I don't really have much control on how WL handles rollback runtime exceptions. Since I have my DAOs throwing checked exceptions, I wrote a Session flush helper in the DAO manager, so it will now check those exceptions. I'm going to use an explicit call to context.setRollbackOnly() to rollback in these instances.

Thanks much!
Lou