openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amitm <amitta...@gmail.com>
Subject Problem with bulk persist with programmatic transaction in OpenJpa 1.2.1 jar
Date Tue, 10 Nov 2009 06:12:01 GMT

Hi,
  I have updated OpenJpa jar to version 1.2.1 from 1.0.1. I am facing a
strange problem. I have an object which is having a OneToMany field. This
object is being persisted in database in bulk. I am reading a CSV file and
populating this object and then saving the objects in batch. For this I have
used programmatic transaction. While populating the object this OneToMany
field is accessed and the value for the same is populated. I am getting
following exception in the first batch of data. After that it is working
fine. What is more strange to me is that this exception is not apppearing
with OpenJpa 1.0.1, the one I was earling using.

openjpa-1.2.1-runknown fatal user error>
org.apache.openjpa.persistence.InvalidStateException: The context has been
closed.  The stack trace at which the context was closed is held in the
embedded exception.
FailedObject: java.lang.IllegalStateException
    at org.apache.openjpa.kernel.BrokerImpl.assertOpen(BrokerImpl.java:4370)
    at
org.apache.openjpa.kernel.BrokerImpl.beginOperation(BrokerImpl.java:1766)
    at org.apache.openjpa.kernel.BrokerImpl.isActive(BrokerImpl.java:1736)
    at
org.apache.openjpa.kernel.StateManagerImpl.beforeRead(StateManagerImpl.java:942)
    at
org.apache.openjpa.kernel.StateManagerImpl.accessingField(StateManagerImpl.java:1477)
    at
com.elasticpath.domain.attribute.impl.AttributeImpl.getKey(AttributeImpl.java)
    at
com.elasticpath.domain.attribute.impl.AttributeValueGroupImpl.setStringAttributeValue(AttributeValueGroupImpl.java:123)
    at
com.elasticpath.domain.dataimport.impl.ImportDataTypeProductImpl$10.setStringValue(ImportDataTypeProductImpl.java:563)
    at
com.elasticpath.service.dataimport.impl.AbstractImportJobRunnerImpl.updateContent(AbstractImportJobRunnerImpl.java:676)
    at
com.elasticpath.service.dataimport.impl.AbstractImportJobRunnerImpl.insertAndUpdate(AbstractImportJobRunnerImpl.java:619)
    at
com.elasticpath.service.dataimport.impl.AbstractImportJobRunnerImpl.importOneRow(AbstractImportJobRunnerImpl.java:521)
    at
com.elasticpath.service.dataimport.impl.AbstractImportJobRunnerImpl.run(AbstractImportJobRunnerImpl.java:370)
    at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.IllegalStateException
    at org.apache.openjpa.kernel.BrokerImpl.free(BrokerImpl.java:4148)
    at org.apache.openjpa.kernel.BrokerImpl.close(BrokerImpl.java:4078)
    at
org.apache.openjpa.kernel.DelegatingBroker.close(DelegatingBroker.java:1298)
    at
org.apache.openjpa.persistence.EntityManagerImpl.close(EntityManagerImpl.java:1106)
    at
org.springframework.orm.jpa.JpaTransactionManager.doCleanupAfterCompletion(JpaTransactionManager.java:508)
    at
org.springframework.transaction.support.AbstractPlatformTransactionManager.cleanupAfterCompletion(AbstractPlatformTransactionManager.java:908)
    at
org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:701)
    at
org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:621)
    at
org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:311)
    at
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:117)
    at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
    at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:203)
    at $Proxy309.runImportJob(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
    at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:172)
    at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:139)
    at
org.springframework.remoting.support.RemoteInvocationTraceInterceptor.invoke(RemoteInvocationTraceInterceptor.java:70)
    at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
    at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:203)
    at $Proxy324.runImportJob(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at
org.springframework.remoting.support.RemoteInvocation.invoke(RemoteInvocation.java:205)
    at
org.springframework.remoting.support.DefaultRemoteInvocationExecutor.invoke(DefaultRemoteInvocationExecutor.java:38)
    at
org.springframework.remoting.support.RemoteInvocationBasedExporter.invoke(RemoteInvocationBasedExporter.java:76)
    at
org.springframework.remoting.support.RemoteInvocationBasedExporter.invokeAndCreateResult(RemoteInvocationBasedExporter.java:112)
    at
org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.handleRequest(HttpInvokerServiceExporter.java:117)
    at
org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:49)
    at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:839)
    at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:774)
    at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:460)
    at
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:425)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
com.elasticpath.commons.filter.impl.CachingControlFilter.doFilter(CachingControlFilter.java:163)
    at
com.elasticpath.cmweb.filters.EpFilterToBeanProxy.doFilter(EpFilterToBeanProxy.java:137)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
    at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
    at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
    at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
    at
org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
    at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
    at
org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)
    at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
    at
org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
    at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
    at
org.acegisecurity.securechannel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:138)
    at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
    at
org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
    at
org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
com.elasticpath.commons.filter.impl.EncodingFilter.handleFilter(EncodingFilter.java:138)
    at
com.elasticpath.commons.filter.impl.EncodingFilter.doFilter(EncodingFilter.java:81)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
    at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)

Has anyone faced this type of situation with OpenJpa1.2.1 before?
-- 
View this message in context: http://n2.nabble.com/Problem-with-bulk-persist-with-programmatic-transaction-in-OpenJpa-1-2-1-jar-tp3977999p3977999.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message