This discussion is archived
10 Replies Latest reply: Jul 11, 2012 2:21 AM by user11359507 RSS

EclipseLink: Deadlock when returning Entities from a remote method call

769457 Newbie
Currently Being Moderated
Build Identifier: org.eclipse.persistence_1.0.0.0_1-1-0.jar (Included with
weblogic 10.3.1)

On our production machine we are seeing deadlocks like the following:

Found one Java-level deadlock:
=============================
"[ACTIVE] ExecuteThread: '40' for queue: 'weblogic.kernel.Default
(self-tuning)'":
waiting to lock monitor 0x00000000173f87e8 (object 0x00000000bdf32c48, a
java.util.Vector),
which is held by "[ACTIVE] ExecuteThread: '37' for queue:
'weblogic.kernel.Default (self-tuning)'"
"[ACTIVE] ExecuteThread: '37' for queue: 'weblogic.kernel.Default
(self-tuning)'":
waiting to lock monitor 0x0000000017393af0 (object 0x00000000aa5e15a0, a
java.util.Vector),
which is held by "[ACTIVE] ExecuteThread: '32' for queue:
'weblogic.kernel.Default (self-tuning)'"
"[ACTIVE] ExecuteThread: '32' for queue: 'weblogic.kernel.Default
(self-tuning)'":
waiting to lock monitor 0x0000000017522268 (object 0x00000000b30492e0, a
java.util.Vector),
which is held by "[ACTIVE] ExecuteThread: '37' for queue:
'weblogic.kernel.Default (self-tuning)'"

Java stack information for the threads listed above:
===================================================
"[ACTIVE] ExecuteThread: '40' for queue: 'weblogic.kernel.Default
(self-tuning)'":
at java.util.Vector.size(Vector.java:268)
- waiting to lock <0x00000000bdf32c48> (a java.util.Vector)
at
org.eclipse.persistence.indirection.IndirectList.size(IndirectList.java:711)
at
org.eclipse.persistence.internal.queries.CollectionContainerPolicy.sizeFor(CollectionContainerPolicy.java:175)
at
org.eclipse.persistence.mappings.CollectionMapping.buildCloneForPartObject(CollectionMapping.java:152)
at
org.eclipse.persistence.internal.indirection.UnitOfWorkQueryValueHolder.buildCloneFor(UnitOfWorkQueryValueHolder.java:51)
at
org.eclipse.persistence.internal.indirection.UnitOfWorkValueHolder.instantiateImpl(UnitOfWorkValueHolder.java:162)
at
org.eclipse.persistence.internal.indirection.UnitOfWorkValueHolder.instantiate(UnitOfWorkValueHolder.java:230)
at
org.eclipse.persistence.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:83)
- locked <0x0000000139ea0f80> (a
org.eclipse.persistence.internal.indirection.UnitOfWorkQueryValueHolder)
at
org.eclipse.persistence.indirection.IndirectList.buildDelegate(IndirectList.java:220)
at
org.eclipse.persistence.indirection.IndirectList.getDelegate(IndirectList.java:386)
- locked <0x0000000139e9fd80> (a
org.eclipse.persistence.indirection.IndirectList)
at
org.eclipse.persistence.indirection.IndirectList$1.<init>(IndirectList.java:514)
at
org.eclipse.persistence.indirection.IndirectList.listIterator(IndirectList.java:513)
at
org.eclipse.persistence.indirection.IndirectList.iterator(IndirectList.java:477)
at
de.evelopment.retail.lvs.ejb.comm.PDAManagerBean.checkDirektzuweisungVersandbereich(PDAManagerBean.java:2927)
at sun.reflect.GeneratedMethodAccessor583.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at
com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at
com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at
com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at
com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at
com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at
com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
at
weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
at
com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
at
com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at
com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at
com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at
com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at
com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at
com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at
com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy259.checkDirektzuweisungVersandbereich(Unknown Source)
at
de.evelopment.retail.lvs.ejb.comm.pdaManager_q3ru28_PDAManagerLocalImpl.checkDirektzuweisungVersandbereich(pdaManager_q3ru28_PDAManagerLocalImpl.java:11006)
at
de.evelopment.retail.lvs.servlet.command.RetourenDirektzuweisungCommand.step_LagerplatzScan(RetourenDirektzuweisungCommand.java:397)
at
de.evelopment.retail.lvs.servlet.command.RetourenDirektzuweisungCommand.execute(RetourenDirektzuweisungCommand.java:118)
at
de.evelopment.retail.lvs.servlet.MCPServlet.handleRequest(MCPServlet.java:573)
at
de.evelopment.retail.lvs.servlet.MCPServlet.doRequest(MCPServlet.java:407)
at de.evelopment.retail.lvs.servlet.MCPServlet.doPost(MCPServlet.java:285)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at
weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at
weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3590)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2200)
at
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2106)
at
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1428)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
"[ACTIVE] ExecuteThread: '37' for queue: 'weblogic.kernel.Default
(self-tuning)'":
at java.util.Vector.writeObject(Vector.java:1012)
- waiting to lock <0x00000000aa5e15a0> (a java.util.Vector)
at sun.reflect.GeneratedMethodAccessor306.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at
java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:416)
at java.util.Vector.writeObject(Vector.java:1012)
- locked <0x00000000bdf32c48> (a java.util.Vector)
at sun.reflect.GeneratedMethodAccessor306.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at
java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:416)
at java.util.Vector.writeObject(Vector.java:1012)
- locked <0x00000000c85eab48> (a java.util.Vector)
at sun.reflect.GeneratedMethodAccessor306.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at
java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:416)
at java.util.Vector.writeObject(Vector.java:1012)
- locked <0x00000000b30492e0> (a java.util.Vector)
at sun.reflect.GeneratedMethodAccessor306.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at
java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:416)
at java.util.Vector.writeObject(Vector.java:1012)
- locked <0x00000000947276a8> (a java.util.Vector)
at sun.reflect.GeneratedMethodAccessor306.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at
weblogic.rjvm.MsgAbbrevOutputStream.writeObject(MsgAbbrevOutputStream.java:618)
at
weblogic.utils.io.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:63)
at
de.evelopment.retail.lvs.ejb.stammdaten.ArtikelManagerBean_uicp0e_ArtikelManagerRemoteImpl_WLSkel.invoke(Unknown
Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
at
weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
at
weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
at
weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
"[ACTIVE] ExecuteThread: '32' for queue: 'weblogic.kernel.Default
(self-tuning)'":
at java.util.Vector.writeObject(Vector.java:1012)
- waiting to lock <0x00000000b30492e0> (a java.util.Vector)
at sun.reflect.GeneratedMethodAccessor306.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at
java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:416)
at java.util.Vector.writeObject(Vector.java:1012)
- locked <0x00000000aa5e15a0> (a java.util.Vector)
at sun.reflect.GeneratedMethodAccessor306.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at
weblogic.rjvm.MsgAbbrevOutputStream.writeObject(MsgAbbrevOutputStream.java:618)
at
weblogic.utils.io.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:63)
at
de.evelopment.retail.lvs.ejb.stammdaten.ArtikelManagerBean_uicp0e_ArtikelManagerRemoteImpl_WLSkel.invoke(Unknown
Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
at
weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
at
weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
at
weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

Found 1 deadlock.

This always happens when returning entities form a method.
My belief is, that this is caused by writing object of type
NonSynchronizedVector to the stream.
This implements a writeObject() method, but still Vector.writeObject() is
called.
  • 1. Re: EclipseLink: Deadlock when returning Entities from a remote method call
    JamesSutherland Pro
    Currently Being Moderated
    The issue seems to be cause by your writing of the same sets of objects from two different threads at the same time, from opposite directions.

    Vector serialization is synchronized, so each thread locks one vector then is serializing the nested vector and hits the others lock.

    I assume you are not using the Vector yourself in your model, but using List and LAZY, and our IndirectList uses Vector by default.

    How are the two threads sharing the same objects? Are you reading directly from the ServerSession, or using read-only queries?

    One solution would be to change your type from List to Set, then our default type will be HashSet. You could also use the type ArrayList (but without LAZY).
    You could also read the objects using a UnitOfWork or through the EntityManager as not read-only which will return copies, so each thread will get its own objects.

    We should provide an option to use ArrayList in IndirectList instead of Vector, please log this issue.


    ---
    James : www.eclipselink.org
  • 2. Re: EclipseLink: Deadlock when returning Entities from a remote method call
    769457 Newbie
    Currently Being Moderated
    Hi James,

    first thank you very much for the quick answer.

    We've already opened a bug at EclipseLink Buglist: https://bugs.eclipse.org/bugs/show_bug.cgi?id=309822 last week.

    Your assumption ist correct, we are using List and LAZY loading. We don’t use read-only queries and we don't read directly from the ServerSession. We are using the EntityManager in Stateless Session Beans via Injection.

    We don’t know how 2 threads are sharing the same object. Our belief is, that there is a problem with the shared cache when the deadlock occurs.
    Our understanding is that the shared cache returns a copy of the object.
    If we try to load the Object with our client, the thread waits for the object locked by the deadlocked thread. If we invalidate the cache before calling the remote method from the client, the object can be written back to the client without waiting for the lock by the deadlocked thread.
    Cache invalidation:
    ((org.eclipse.persistence.internal.jpa.EntityManagerImpl)em.getDelegate()).getServerSession().getIdentityMapAccessor().invalidateAll();

    We will try to change IndirectList to avoid the deadlock:

    Implementing Externalizable and adding the following methods
    @Override
    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    capacityIncrement = in.readInt();
    elementCount = in.readInt();
    elementData = (Object[]) in.readObject();
    }

    @Override
    public void writeExternal(ObjectOutput out) throws IOException {
    out.writeInt(capacityIncrement);
    out.writeInt(elementCount);
    out.writeObject(elementData);
    }

    Astrid & Michael
  • 3. Re: EclipseLink: Deadlock when returning Entities from a remote method call
    769457 Newbie
    Currently Being Moderated
    Hi James, we have an additional question regarding „The issue seems to be cause by your writing of the same sets of objects from two different threads at the same time, from opposite directions.“ Is this only a problem with EAGER loading or can this also occur using LAZY Loading?
  • 4. Re: EclipseLink: Deadlock when returning Entities from a remote method call
    JamesSutherland Pro
    Currently Being Moderated
    The Vector serialization issue could occur with either LAZY or EAGER, as long as their is a vector there. By default EclipseLink will use Vector for List if it is EAGER, but if you made the type ArrayList or set the mapping's collectionClass then you could use ArrayList. With LAZY it will always be an IndirectList, which is both a subclass of Vector and uses a Vector to hold the collection.

    It sounds like you cache may be getting corrupted if you are unintentionally getting a reference to a share object, you may wish to investigate why this is occurring as fixing it should fix your serialization issue.
  • 5. Re: EclipseLink: Deadlock when returning Entities from a remote method call
    user11359507 Newbie
    Currently Being Moderated
    Hi James,

    thank you for your answer!

    We didn't change the IndirectList but we changed our relations from List to Set.
    Most of our relations have Set and LAZY loading now. Some relations are using EAGER loading. Some of our relations are bidirectional relations.
    We also use NamedQueries some of them with @QueryHint-Annotation like the following: hints = { @QueryHint(name = QueryHints.CACHE_USAGE, value = CacheUsage.CheckCacheThenDatabase) })

    Our produtction machines works since yesterday evening without a deadlock. But now we have another problem. An object seems to be locked in the shared cache. After half an hour the object isnt' released yet. If we try to access the object with a EntityManager.find from a remote call this thread waits for the lock.
    Even the cache invalitation isn't possible.

    "[STUCK] ExecuteThread: '19' for queue: 'weblogic.kernel.Default (self-tuning)'" daemon prio=2 tid=0x00000000157db800 nid=0x14dc in Object.wait() [0x00000000221ba000]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         - waiting on <0x00000000c8b81de0> (a org.eclipse.persistence.internal.helper.ConcurrencyManager)
         at java.lang.Object.wait(Object.java:485)
         at org.eclipse.persistence.internal.helper.WriteLockManager.acquireLocksForClone(WriteLockManager.java:82)
         - locked <0x00000000c8b81de0> (a org.eclipse.persistence.internal.helper.ConcurrencyManager)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.cloneAndRegisterObject(UnitOfWorkImpl.java:894)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.cloneAndRegisterObject(UnitOfWorkImpl.java:832)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkIdentityMapAccessor.getAndCloneCacheKeyFromParent(UnitOfWorkIdentityMapAccessor.java:171)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkIdentityMapAccessor.getFromIdentityMap(UnitOfWorkIdentityMapAccessor.java:110)
         at org.eclipse.persistence.internal.sessions.IdentityMapAccessor.getFromIdentityMap(IdentityMapAccessor.java:327)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerExistingObject(UnitOfWorkImpl.java:3781)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerExistingObject(UnitOfWorkImpl.java:3741)
         at org.eclipse.persistence.queries.ObjectBuildingQuery.registerIndividualResult(ObjectBuildingQuery.java:362)
         at org.eclipse.persistence.queries.ReadObjectQuery.registerResultInUnitOfWork(ReadObjectQuery.java:714)
         at org.eclipse.persistence.queries.ObjectLevelReadQuery.checkEarlyReturn(ObjectLevelReadQuery.java:650)
         at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:613)
         at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:889)
         at org.eclipse.persistence.queries.ReadObjectQuery.execute(ReadObjectQuery.java:397)
         at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:952)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2755)
         at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1181)
         at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1165)
         at org.eclipse.persistence.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:81)
         at org.eclipse.persistence.internal.indirection.QueryBasedValueHolder.instantiateForUnitOfWorkValueHolder(QueryBasedValueHolder.java:96)
         at org.eclipse.persistence.internal.indirection.UnitOfWorkValueHolder.instantiateImpl(UnitOfWorkValueHolder.java:156)
         - locked <0x00000000b392ba18> (a org.eclipse.persistence.internal.indirection.QueryBasedValueHolder)
         at org.eclipse.persistence.internal.indirection.UnitOfWorkValueHolder.instantiate(UnitOfWorkValueHolder.java:230)
         at org.eclipse.persistence.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:83)
         - locked <0x00000000ec0a43f8> (a org.eclipse.persistence.internal.indirection.UnitOfWorkQueryValueHolder)
         at de.evelopment.retail.lvs.ejb.lagerbewegungen.LagerungsEinheitBean._persistence_getreservierung(LagerungsEinheitBean.java)
         at de.evelopment.retail.lvs.ejb.lagerbewegungen.LagerungsEinheitBean.getReservierung(LagerungsEinheitBean.java:439)


    Remote call with EntityManager.find

    "[STUCK] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)'" daemon prio=2 tid=0x00000000157db000 nid=0xe64 in Object.wait() [0x00000000220bd000]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         - waiting on <0x00000000c8b81de0> (a org.eclipse.persistence.internal.helper.ConcurrencyManager)
         at java.lang.Object.wait(Object.java:485)
         at org.eclipse.persistence.internal.helper.WriteLockManager.acquireLocksForClone(WriteLockManager.java:82)
         - locked <0x00000000c8b81de0> (a org.eclipse.persistence.internal.helper.ConcurrencyManager)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.cloneAndRegisterObject(UnitOfWorkImpl.java:894)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.cloneAndRegisterObject(UnitOfWorkImpl.java:832)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkIdentityMapAccessor.getAndCloneCacheKeyFromParent(UnitOfWorkIdentityMapAccessor.java:171)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkIdentityMapAccessor.getFromIdentityMap(UnitOfWorkIdentityMapAccessor.java:110)
         at org.eclipse.persistence.internal.sessions.IdentityMapAccessor.getFromIdentityMap(IdentityMapAccessor.java:327)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerExistingObject(UnitOfWorkImpl.java:3781)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerExistingObject(UnitOfWorkImpl.java:3741)
         at org.eclipse.persistence.queries.ObjectBuildingQuery.registerIndividualResult(ObjectBuildingQuery.java:362)
         at org.eclipse.persistence.queries.ObjectLevelReadQuery.conformIndividualResult(ObjectLevelReadQuery.java:733)
         at org.eclipse.persistence.queries.ReadObjectQuery.conformResult(ReadObjectQuery.java:344)
         at org.eclipse.persistence.queries.ReadObjectQuery.registerResultInUnitOfWork(ReadObjectQuery.java:708)
         at org.eclipse.persistence.queries.ObjectLevelReadQuery.checkEarlyReturn(ObjectLevelReadQuery.java:650)
         at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:613)
         at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:889)
         at org.eclipse.persistence.queries.ReadObjectQuery.execute(ReadObjectQuery.java:397)
         at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:952)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2755)
         at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1181)
         at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1165)
         at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1125)
         at org.eclipse.persistence.internal.jpa.EntityManagerImpl.executeQuery(EntityManagerImpl.java:561)
         at org.eclipse.persistence.internal.jpa.EntityManagerImpl.findInternal(EntityManagerImpl.java:509)
         at org.eclipse.persistence.internal.jpa.EntityManagerImpl.find(EntityManagerImpl.java:428)
         at org.eclipse.persistence.internal.jpa.EntityManagerImpl.find(EntityManagerImpl.java:336)
         at sun.reflect.GeneratedMethodAccessor261.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:90)
         at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:89)
         at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:80)
         at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:24)
         at $Proxy115.find(Unknown Source)
         at de.evelopment.retail.lvs.ejb.lagererrichtung.LagerErrichtungManagerBean.getLagerPlatz(LagerErrichtungManagerBean.java:3505)

    Cache invalidation:

    "[STUCK] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'" daemon prio=2 tid=0x000000000d844000 nid=0x1200 in Object.wait() [0x0000000010f9e000]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         - waiting on <0x00000000c8b86850> (a org.eclipse.persistence.internal.helper.ConcurrencyManager)
         at java.lang.Object.wait(Object.java:485)
         at org.eclipse.persistence.internal.helper.ConcurrencyManager.acquireReadLock(ConcurrencyManager.java:242)
         - locked <0x00000000c8b86850> (a org.eclipse.persistence.internal.helper.ConcurrencyManager)
         at org.eclipse.persistence.internal.helper.ConcurrencyManager.checkReadLock(ConcurrencyManager.java:230)
         at org.eclipse.persistence.internal.identitymaps.CacheKey.checkReadLock(CacheKey.java:180)
         at org.eclipse.persistence.internal.identitymaps.IdentityMapKeyEnumeration.nextElement(IdentityMapKeyEnumeration.java:42)
         at org.eclipse.persistence.internal.sessions.IdentityMapAccessor.invalidateClass(IdentityMapAccessor.java:677)
         at org.eclipse.persistence.internal.sessions.IdentityMapAccessor.invalidateClass(IdentityMapAccessor.java:657)
         at org.eclipse.persistence.internal.sessions.IdentityMapAccessor.invalidateAll(IdentityMapAccessor.java:695)
  • 6. Re: EclipseLink: Deadlock when returning Entities from a remote method call
    JamesSutherland Pro
    Currently Being Moderated
    This seems to be an unrelated deadlock.

    The three threads cannot be deadlocking on each-other, so their must be some other threads with locks. What are the other threads in the stack?

    There is a method on IdentityMapAccessor.printIdentityMapLocks() that will print all of the threads with locks.

    There have been some deadlocks fixed in the latest release, perhaps try the 2.1 trunk jar, or latest 2.0 patch to see if it resolves the issue.

    The deadlock is probably related to using EAGER, if you switch to using LAZY this may resolve the issue, and is recommended in general.
  • 7. Re: EclipseLink: Deadlock when returning Entities from a remote method call
    user11359507 Newbie
    Currently Being Moderated
    Hi James,

    now we changed all our relations usiny eager loading to lazy loading.

    Additional to find the cause of the cache corruption, we have added some runtime instrumentation to call the following method, when the "_persistence_getversandBereich" method is called (versandBereich is a @ManyToOne relation):

    public static void checkCacheModification(Object obj) {
    try {
    System.out.println("Object: " + obj);
    Field field =
    AbstractEntity.class.getDeclaredField("_persistence_cacheKey");
    field.setAccessible(true);
    CacheKey cacheKey = (CacheKey) field.get(obj);
    Object sharedCacheValue = cacheKey.getObject();
    if (sharedCacheValue == obj) {
    LOG.fatal("WORKING ON CACHE COPY :(", new Exception());
    }

    } catch (Exception e) {
    e.printStackTrace();
    }
    }

    With this method we try to find calls to this method, that are executed on the object in the shared object cache.
    One call that triggers the ThreadDump is the following:

    ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'
    FATAL ejb.common.EJBUtil.checkCacheModification[235] - WORKING ON CACHE COPY :(

    java.lang.Exception

         at de.evelopment.retail.lvs.ejb.common.EJBUtil.checkCacheModification(EJBUtil.java:235)

         at de.evelopment.retail.lvs.ejb.stammdaten.Artikel._persistence_getversandBereich(Artikel.java)

         at de.evelopment.retail.lvs.ejb.stammdaten.Artikel._persistence_setversandBereich_vh(Artikel.java)

         at sun.reflect.GeneratedMethodAccessor181.invoke(Unknown Source)

         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

         at java.lang.reflect.Method.invoke(Method.java:597)

         at org.eclipse.persistence.internal.descriptors.MethodAttributeAccessor.setAttributeValueInObject(MethodAttributeAccessor.java:193)

         at org.eclipse.persistence.mappings.DatabaseMapping.setAttributeValueInObject(DatabaseMapping.java:1246)

         at org.eclipse.persistence.mappings.DatabaseMapping.readFromRowIntoObject(DatabaseMapping.java:1137)

         at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder.java:325)

         at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:704)

         at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildWorkingCopyCloneNormally(ObjectBuilder.java:574)

         at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObjectInUnitOfWork(ObjectBuilder.java:544)

         at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:485)

         at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:437)

         at org.eclipse.persistence.queries.ObjectLevelReadQuery.buildObject(ObjectLevelReadQuery.java:569)

         at org.eclipse.persistence.queries.ObjectLevelReadQuery.conformIndividualResult(ObjectLevelReadQuery.java:731)

         at org.eclipse.persistence.queries.ReadObjectQuery.conformResult(ReadObjectQuery.java:344)

         at org.eclipse.persistence.queries.ReadObjectQuery.registerResultInUnitOfWork(ReadObjectQuery.java:708)

         at org.eclipse.persistence.queries.ReadObjectQuery.executeObjectLevelReadQuery(ReadObjectQuery.java:436)

         at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:928)

         at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:664)

         at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:889)

         at org.eclipse.persistence.queries.ReadObjectQuery.execute(ReadObjectQuery.java:397)

         at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:952)

         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2755)

         at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1181)

         at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1165)

         at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1125)

         at org.eclipse.persistence.internal.jpa.EntityManagerImpl.executeQuery(EntityManagerImpl.java:561)

         at org.eclipse.persistence.internal.jpa.EntityManagerImpl.findInternal(EntityManagerImpl.java:509)

         at org.eclipse.persistence.internal.jpa.EntityManagerImpl.find(EntityManagerImpl.java:428)

         at org.eclipse.persistence.internal.jpa.EntityManagerImpl.find(EntityManagerImpl.java:336)

    Looking at the comment in ClassWeaver.java the persistencesetversandBereich_vh should look like;

    * public void
    persistencesetversandBereich_vh(WeavedAttributeValueHolderInterface
    valueholderinterface){
    * persistencefoo_vh = valueholderinterface;
    * if (valueholderinterface.isInstantiated()){
    * Object object = getVersandBereich();
    * Object value = valueholderinterface.getValue();
    * if (object != value){
    * setVersandBereich((EntityC)value);
    * }
    * }
    * }

    My question is: If this method is called on an object in the shared object cache and valueholderinterface is already instantiated: Will this cause this the Relationship to be initialized? What happens if this object is then cloned? Will the cloned copy still contain the same value for versandBereich?
    Can this be the cause for our problem, that multiple threads get the same copy of the "versandBereich" object?
  • 8. Re: EclipseLink: Deadlock when returning Entities from a remote method call
    399257 Explorer
    Currently Being Moderated
    In this stacktrace EclipseLink is building the parent object into the shared cache. That is why your instrumentation is raising an exception.
    In reponce to your question the only time this method would be called on an object in the shared cache would be on an initial load (as we see here in the stacktrace) or a refresh. In both cache a new un-instantiated ValueHolder would be placed in the attribute.

    When an object is cloned the cloned version in the PersistenceContext/EntityManager would contain a UnitOfWorkValueHolder for this attribute that would reference the valueHolder from the Entity in the shared cache. When the attribute is trigger/instantiated within the clone from the PersistenceContext/EntityManager the ValueHolder in the shared cache is instantiated within the context of the shared cache and then the values of that shared ValueHolder are then cloned within the PersistenceContext/EntityManager and these clones are set into the attribute of the clone within the PersistenceContext/EntityManager. So only PersistenceContext/EntityManager clones reference other PersistenceContext/EntityManager clones and no shared cache clones.

    Are you sure this is a reference to a shared object that is causing the issue? Is it possible you are using an Extended EntityManager or an Application Managed EntityManager within a Stateless Session Bean which the container may be sharing amoung multiple callers?
  • 9. Re: EclipseLink: Deadlock when returning Entities from a remote method call
    user11359507 Newbie
    Currently Being Moderated
    We have now reproduced the underlying problem.
    A testcase/comment is attached to eclipselink bug 309822 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=309822).

    The problem seems to be that objects in the L2 cache still contain references to other Entities. This does not matter when working with attached objects, since the values are taken from the value holder objects and not from the fields.
    But when serializing the objects with LAZY relationshsips, that are not used on the server side, the values from the L2 cache get serialized and send back to the client..
  • 10. Re: EclipseLink: Deadlock when returning Entities from a remote method call
    user11359507 Newbie
    Currently Being Moderated
    We noticed a fixed bug for eclipselink 2.4.0 (Bug 370297 - Possibility of a deadlock between merging collection into shared cache and IndirectList) and executed our attached testcase on bug "309822 - Deadlock when returning Entities from a remote method call" with eclipselink 2.4.0 without using our cloneCopyPolicy.
    The result is the expected behaviour in our first post of the bug.

    Can we expect, that our problem is solved with the bug 370297 in eclipselink 2.4.0?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points