geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From the666pack <mario.kof...@gmail.com>
Subject OptimisticLockException
Date Mon, 17 Mar 2008 06:46:07 GMT

Hello,

so i try to test the server how it handles concurrent delete requests. i
start quite low with 5 concurrent users trying to delete some values from
the database. the problem is that i keep getting the error mentioned in the
subject. the more concurrent users i schedule, the more errors i get until
about 30 concurrent users the performance levels off quite low. the thing i
do in my code is removing a persistent entity:

           // em.lock(director,LockModeType.WRITE); //optimistic lock
exception??????
            em.remove(director);
            //em.flush();                 //because of optimistic lock
exception
            deleted++;

i also tried with the help of the commented out lines, but without a
significant performance increase, here is the error log, maybe someone could
help, THANK YOU!

 [exec] Caused by: <openjpa-1.0.0-r420667:568756 nonfatal store error>
org.apache.openjpa.persistence.OptimisticLockException: An optimistic lock
violation was detected when flushing object instance
"vt.bean.entity.Director-1192302" to the data store.  This indicates that
the object was concurrently modified in another transaction.
     [exec] FailedObject: vt.bean.entity.Director-1192302
     [exec]     at
org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:101)
     [exec]     at
org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:73)
     [exec]     at
org.apache.openjpa.jdbc.kernel.OperationOrderUpdateManager.flushPrimaryRow(OperationOrderUpdateManager.java:162)
     [exec]     at
org.apache.openjpa.jdbc.kernel.OperationOrderUpdateManager.flush(OperationOrderUpdateManager.java:89)
     [exec]     at
org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:89)
     [exec]     at
org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:72)
     [exec]     at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:514)
     [exec]     at
org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
     [exec]     ... 42 more
     [exec] NestedThrowables:
     [exec] <openjpa-1.0.0-r420667:568756 nonfatal store error>
org.apache.openjpa.persistence.OptimisticLockException: An optimistic lock
violation was detected when flushing object instance
"vt.bean.entity.Director-1192302" to the data store.  This indicates that
the object was concurrently modified in another transaction.
     [exec] FailedObject: vt.bean.entity.Director-1192302
     [exec]     at
org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:101)
     [exec]     at
org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:73)
     [exec]     at
org.apache.openjpa.jdbc.kernel.OperationOrderUpdateManager.flushPrimaryRow(OperationOrderUpdateManager.java:162)
     [exec]     at
org.apache.openjpa.jdbc.kernel.OperationOrderUpdateManager.flush(OperationOrderUpdateManager.java:89)
     [exec]     at
org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:89)
     [exec]     at
org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:72)
     [exec]     at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:514)
     [exec]     at
org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
     [exec]     at
org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1946)
     [exec]     at
org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1844)
     [exec]     at
org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1615)
     [exec]     at
org.apache.openjpa.kernel.DelegatingBroker.flush(DelegatingBroker.java:973)
     [exec]     at
org.apache.openjpa.persistence.EntityManagerImpl.flush(EntityManagerImpl.java:488)
     [exec]     at
vt.bean.stateless.DeleteDataBean.removeDirectors(DeleteDataBean.java:115)
     [exec]     at sun.reflect.GeneratedMethodAccessor175.invoke(Unknown
Source)
     [exec]     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [exec]     at java.lang.reflect.Method.invoke(Method.java:597)
     [exec]     at
org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:146)
     [exec]     at
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:129)
     [exec]     at
org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:67)
     [exec]     at
org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:203)
     [exec]     at
org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:165)
     [exec]     at
org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:223)
     [exec]     at
org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:77)
     [exec]     at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:245)
     [exec]     at
org.apache.openejb.util.proxy.Jdk13InvocationHandler.invoke(Jdk13InvocationHandler.java:49)
     [exec]     at $Proxy23.removeDirectors(Unknown Source)
     [exec]     at
org.apache.jsp.removeTool_jsp._jspService(removeTool_jsp.java:163)
     [exec]     at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
     [exec]     at
javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
     [exec]     at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
     [exec]     at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
     [exec]     at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
     [exec]     at
javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
     [exec]     at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
     [exec]     at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     [exec]     at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
     [exec]     at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
     [exec]     at
org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
     [exec]     at
org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:353)
     [exec]     at
org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
     [exec]     at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
     [exec]     at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
     [exec]     at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
     [exec]     at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
     [exec]     at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
     [exec]     at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
     [exec]     at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
     [exec]     at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
     [exec]     at java.lang.Thread.run(Thread.java:619)
     [exec] 07:12:28,046 ERROR [[jsp]] Servlet.service() for servlet jsp
threw exception
     [exec] java.lang.Exception: <openjpa-1.0.0-r420667:568756 nonfatal
store error> org.apache.openjpa.persistence.OptimisticLockException: An
optimistic lock violation was detected when flushing object instance
"vt.bean.entity.Director-1192302" to the data store.  This indicates that
the object was concurrently modified in another transaction.
     [exec] FailedObject: vt.bean.entity.Director-1192302
     [exec]     at
org.apache.openjpa.util.Exceptions.replaceNestedThrowables(Exceptions.java:242)
     [exec]     at
org.apache.openjpa.persistence.OptimisticLockException.writeObject(OptimisticLockException.java:101)
     [exec]     at sun.reflect.GeneratedMethodAccessor179.invoke(Unknown
Source)
     [exec]     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [exec]     at java.lang.reflect.Method.invoke(Method.java:597)
     [exec]     at
java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
     [exec]     at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
     [exec]     at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
     [exec]     at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
     [exec]     at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
     [exec]     at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
     [exec]     at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
     [exec]     at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
     [exec]     at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
     [exec]     at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.copyObj(BaseEjbProxyHandler.java:508)
     [exec]     at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:250)
     [exec]     at
org.apache.openejb.util.proxy.Jdk13InvocationHandler.invoke(Jdk13InvocationHandler.java:49)
     [exec]     at $Proxy23.removeDirectors(Unknown Source)
     [exec]     at
org.apache.jsp.removeTool_jsp._jspService(removeTool_jsp.java:163)
     [exec]     at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
     [exec]     at
javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
     [exec]     at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
     [exec]     at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
     [exec]     at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
     [exec]     at
javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
     [exec]     at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
     [exec]     at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     [exec]     at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
     [exec]     at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
     [exec]     at
org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
     [exec]     at
org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:353)
     [exec]     at
org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
     [exec]     at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
     [exec]     at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
     [exec]     at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
     [exec]     at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
     [exec]     at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
     [exec]     at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
     [exec]     at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
     [exec]     at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
     [exec]     at java.lang.Thread.run(Thread.java:619)
-- 
View this message in context: http://www.nabble.com/OptimisticLockException-tp16089253s134p16089253.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message