Hi,
I'm using Spring Batch with hibernate3.2.3. IBM DB2 V8.1
I got outOfMemory error when i executed batch process.
As per the Batch processing documentation i used session.clear for every 20 records. But i got two different types of exception
One is Found two representations of same collection:
other is R javax.transaction.TransactionRolledbackException: CORBA TRANSACTION_ROLLEDBACK 0x0 No;
Find the stack trace of all the exceptions
org.hibernate.HibernateException: Found two representations of same collection: com.met.ib.upi.webupdates.process.model.Hibernate.ProdAltIdModel.prodAltIdModels at org.hibernate.engine.Collections.processReachableCollection(Collections.java(Compiled Code)) at org.hibernate.event.def.FlushVisitor.processCollection(FlushVisitor.java(Compiled Code)) 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.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java(Compiled Code)) at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java(Compiled Code)) at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76) at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:35) at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:969) at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:1136) at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:94) at com.met.ib.upi.batch.item.writer.EPIWriter.update(EPIWriter.java:142) at com.met.ib.upi.batch.bo.AgencyMergeBO.updatePaiKeyMap(AgencyMergeBO.java:410) at com.met.ib.upi.batch.bo.AgencyMergeBO.terminateProdAgency(AgencyMergeBO.java:1632) at com.met.ib.upi.batch.bo.AgencyMergeBO.processStagingData(AgencyMergeBO.java:167) at com.met.ib.upi.batch.bo.AgencyMergeBO.processAgencyMerge(AgencyMergeBO.java:82) at com.met.ib.upi.batch.item.processor.AgencyMergeChangeProcessor.write(AgencyMergeChangeProcessor.java:46) at org.springframework.batch.item.database.HibernateAwareItemWriter.doWrite(HibernateAwareItemWriter.java:118) at org.springframework.batch.item.database.Abst ractTransactionalResourceItemWriter.write(AbstractTransactionalResourceItemWriter.java:79) at org.springframework.batch.item.support.DelegatingItemWriter.write(DelegatingItemWriter.java:45) at org.springframework.batch.core.step.item.BatchListenerFactoryHelper$2.write(BatchListenerFactoryHelper.java:99) at org.springframework.batch.core.step.item.SimpleItemHandler.doWrite(SimpleItemHandler.java:105) at org.springframework.batch.core.step.item.SkipLimitStepFactoryBean$StatefulRetryItemHandler$1.doWithRetry(SkipLimitStepFactoryBean.java:369) at org.springframework.batch.retry.callback.RecoveryRetryCallback.doWithRetry(RecoveryRetryCallback.java:109) at org.springframework.batch.retry.support.RetryTemplate.execute(RetryTemplate.java:168) at org.springframework.batch.core.step.item.SkipLimitStepFactoryBean$StatefulRetryItemHandler.write(SkipLimitStepFactoryBean.java:383) at org.springframework.batch.core.step.item.SimpleItemHandler.handle(SimpleItemHandler.java:71) at org.springframework.batch.core.step.item.ItemOrientedStep$2.doInIteration(ItemOrientedStep.java:368) at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:346) at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:212) at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:143) at org.springframework.batch.core.step.item.ItemOrientedStep.processChunk(ItemOrientedStep.java:361) at org.springframework.batch.core.step.item.ItemOrientedStep$1.doInIteration(ItemOrientedStep.java:249) at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:346) at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:212) at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:143) at org.springframework.batch.core.step.item.ItemOrientedStep.doExecute(ItemOrientedStep.java:231) at org.springframework.batch.core.step.Abstract Step.execute(AbstractStep.java:170) at org.springframework.batch.core.job.SimpleJob.execute(SimpleJob.java:100) at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:86) at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49) at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:81) at com.met.ib.upi.batch.test.AbstractBatchLauncherTests.testLaunchJob(AbstractBatchLauncherTests.java:89) at com.met.ib.upi.batch.test.AbstractValidatingBatchLauncherTests.testLaunchJob(AbstractValidatingBatchLauncherTests.java:25) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code)) at java.lang.reflect.Method.invoke(Method.java(Compiled Code)) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:76) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at junit.textui.TestRunner.doRun(TestRunner.java:116) at junit.textui.TestRunner.doRun(TestRunner.java:109) at junit.textui.TestRunner.run(TestRunner.java:72) at junit.textui.TestRunner.run(TestRunner.java:57) at com.met.ib.upi.batch.manager.MassTransactionManager.triggerAMTransaction(MassTransactionManager.java:28) at com.met.ib.upi.client.process.UPILoadMain.triggerAMTransaction(UPILoadMain.java:549) at com.met.ib.upi.client.process.UPILoadMain.main(UPILoadMain.java:60) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41) at java.lang.reflect.Method.invoke(Method.java:386) at com.ibm.websphere.client.applicationclient.launchClient.createContainerAndLaunchApp(launchClient.java:627) at com.ibm.websphere.client.applicationclient.launchClient.main(launchClient.java:422) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41) at java.lang.reflect.Method.invoke(Method.java:386) at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:105)
Error2
R javax.transaction.TransactionRolledbackException: CORBA TRANSACTION_ROLLEDBACK 0x0 No; nested exception is: org.omg.CORBA.TRANSACTION_ROLLEDBACK: javax.transaction.TransactionRolledbackException: vmcid: 0x0 minor code: 0 completed: No [9/11/08 11:52:19:427 IST] 98534d SystemErr R at com.ibm.CORBA.iiop.UtilDelegateImpl.mapSystemException(UtilDelegateImpl.java:208) [9/11/08 11:52:19:427 IST] 98534d SystemErr R at com.ibm.CORBA.iiop.UtilDelegateImpl.wrapException(UtilDelegateImpl.java:684) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at javax.rmi.CORBA.Util.wrapException(Util.java:295) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at com.met.ib.upi.process.ejb._UPIBusinessFacade_Stub.addContract(_UPIBusinessFacade_Stub.java:3441) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at com.met.ib.upi.webupdates.actions.ContractAction.execute(ContractAction.java:246) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:983) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:116) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672) [9/11/08 11:52:20:004 IST] 98534d SystemErr R Caused by: org.omg.CORBA.TRANSACTION_ROLLEDBACK: javax.transaction.TransactionRolledbackException: vmcid: 0x0 minor code: 0 completed: No [9/11/08 11:52:20:004 IST] 98534d SystemErr R at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java(Compiled Code)) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java(Compiled Code)) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at java.lang.reflect.Constructor.newInstance(Constructor.java(Compiled Code)) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at com.ibm.rmi.util.ProxyUtil.copyObject(ProxyUtil.java:320) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at com.ibm.CORBA.iiop.UtilDelegateImpl.copyObject(UtilDelegateImpl.java:789) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at javax.rmi.CORBA.Util.copyObject(Util.java:332) [9/11/08 11:52:20:004 IST] 98534d SystemErr R at com.met.ib.upi.process.ejb._UPIBusinessFacade_Stub.addContract(_UPIBusinessFacade_Stub.java:3437) [9/11/08 11:52:20:004 IST] 98534d SystemErr R ... 27 more
Out Of Memory error
JVMST109: Insufficient space in Javaheap to satisfy allocation request E Time: 19,169.481 There was 1 error: 1) testLaunchJob(com.met.ib.upi.batch.test.AMJobTests)java.lang.RuntimeException : java.lang.OutOfMemoryError at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.ret hrow(SimpleJobLauncher.java:99) at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run (SimpleJobLauncher.java:91) at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecut or.java:49) at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(S impleJobLauncher.java:81) at com.met.ib.upi.batch.test.AbstractBatchLauncherTests.testLaunchJob(Ab stractBatchLauncherTests.java:89) at com.met.ib.upi.batch.test.AbstractValidatingBatchLauncherTests.testLa unchJob(AbstractValidatingBatchLauncherTests.java:25) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:85) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:58) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java(Compiled Code)) at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestC ase.java:76) at com.met.ib.upi.batch.manager.MassTransactionManager.triggerAMTransact ion(MassTransactionManager.java:28) at com.met.ib.upi.client.process.UPILoadMain.triggerAMTransaction(UPILoa dMain.java:549) at com.met.ib.upi.client.process.UPILoadMain.main(UPILoadMain.java:60) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:85) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:58) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:60) at com.ibm.websphere.client.applicationclient.launchClient.createContain erAndLaunchApp(launchClient.java:644) at com.ibm.websphere.client.applicationclient.launchClient.main(launchCl ient.java:426) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:85) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:58) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:60) at com.ibm.ws.bootstrap.WSLauncher.run(WSLauncher.java:222) at java.lang.Thread.run(Thread.java:570) Caused by: java.lang.OutOfMemoryError at org.hibernate.util.IdentityMap.entryList(IdentityMap.java(Compiled Co de)) at org.hibernate.util.IdentityMap.entries(IdentityMap.java(Inlined Compi led Code)) at org.hibernate.event.def.AbstractFlushingEventListener.flushCollection s(AbstractFlushingEventListener.java(Compiled Code)) at org.hibernate.event.def.AbstractFlushingEventListener.flushEverything ToExecutions(AbstractFlushingEventListener.java(Compiled Code)) at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(Def aultAutoFlushEventListener.java(Compiled Code)) at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java(C ompiled Code)) at org.hibernate.impl.SessionImpl.list(SessionImpl.java(Compiled Code)) at org.hibernate.impl.QueryImpl.list(QueryImpl.java(Compiled Code)) at com.met.ib.upi.batch.item.reader.EPIReader.read(EPIReader.java(Compil ed Code)) at com.met.ib.upi.batch.bo.MPChangeBO.getAgencyRoleId(MPChangeBO.java(Co mpiled Code)) at com.met.ib.upi.batch.bo.AgencyMergeBO.processProdChange(AgencyMergeBO .java(Compiled Code)) at com.met.ib.upi.batch.bo.AgencyMergeBO.terminateProdAgency(AgencyMerge BO.java(Compiled Code)) at com.met.ib.upi.batch.bo.AgencyMergeBO.processStagingData(AgencyMergeB O.java:172) at com.met.ib.upi.batch.bo.AgencyMergeBO.processAgencyMerge(AgencyMergeB O.java:82) at com.met.ib.upi.batch.item.processor.AgencyMergeChangeProcessor.write( AgencyMergeChangeProcessor.java:46) at org.springframework.batch.item.database.HibernateAwareItemWriter.doWr ite(HibernateAwareItemWriter.java:118) at org.springframework.batch.item.database.AbstractTransactionalResource ItemWriter.write(AbstractTransactionalResourceItemWriter.java:79) at org.springframework.batch.item.support.DelegatingItemWriter.write(Del egatingItemWriter.java:45) at org.springframework.batch.core.step.item.BatchListenerFactoryHelper$2 .write(BatchListenerFactoryHelper.java:99) at org.springframework.batch.core.step.item.SimpleItemHandler.doWrite(Si mpleItemHandler.java:105) at org.springframework.batch.core.step.item.SkipLimitStepFactoryBean$Sta tefulRetryItemHandler$1.doWithRetry(SkipLimitStepFactoryBean.java:369) at org.springframework.batch.retry.callback.RecoveryRetryCallback.doWith Retry(RecoveryRetryCallback.java:109) at org.springframework.batch.retry.support.RetryTemplate.execute(RetryTe mplate.java:168) at org.springframework.batch.core.step.item.SkipLimitStepFactoryBean$Sta tefulRetryItemHandler.write(SkipLimitStepFactoryBean.java:383) at org.springframework.batch.core.step.item.SimpleItemHandler.handle(Sim pleItemHandler.java:71) at org.springframework.batch.core.step.item.ItemOrientedStep$2.doInItera tion(ItemOrientedStep.java:368) at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult (RepeatTemplate.java:346) at org.springframework.batch.repeat.support.RepeatTemplate.executeIntern al(RepeatTemplate.java:212) at org.springframework.batch.repeat.support.RepeatTemplate.iterate(Repea tTemplate.java:143) at org.springframework.batch.core.step.item.ItemOrientedStep.processChun k(ItemOrientedStep.java:361) at org.springframework.batch.core.step.item.ItemOrientedStep$1.doInItera tion(ItemOrientedStep.java:249) at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult (RepeatTemplate.java:346) at org.springframework.batch.repeat.support.RepeatTemplate.executeIntern al(RepeatTemplate.java:212) at org.springframework.batch.repeat.support.RepeatTemplate.iterate(Repea tTemplate.java:143) at org.springframework.batch.core.step.item.ItemOrientedStep.doExecute(I temOrientedStep.java:231) at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep .java:170) at org.springframework.batch.core.job.SimpleJob.execute(SimpleJob.java:1 00) at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run (SimpleJobLauncher.java:86) ... 39 more
|