Re: Confusing lock error solved, but now a restoreSessionWithID lock issue
Re: Confusing lock error solved, but now a restoreSessionWithID lock issue
- Subject: Re: Confusing lock error solved, but now a restoreSessionWithID lock issue
- From: Ken Anderson <email@hidden>
- Date: Sun, 9 Nov 2008 15:45:16 -0500
Also make sure that you're not setting a relationship with an object
from the other editing context. It's likely that some EO is being
passed around, rather than a global ID, which is much safer.
On Nov 7, 2008, at 10:36 PM, Guido Neitzer wrote:
Are you absolutely sure about that? Even doing a localInstanceOf to
a new editing context will block the source editing context.
Are you passing in global ids to your thread?
cug
On 07.11.2008, at 20:13, Saad Laassel wrote:
One would think so looking at the stacktrace, but the only editing
context being accessed as part of that thread is an editing context
that was obtained trough a call to ERXEC.newEditingContext(), hence
why I was asking if it was possible for two different calls to
ERXEC.newEditingContext() to return the same editing context...
-----Original Message-----
From: Guido Neitzer [mailto:email@hidden]
Sent: Fri 11/7/2008 4:52 PM
To: WebObjects Development
Cc: Saad Laassel
Subject: Re: Confusing lock error solved, but now a
restoreSessionWithID lock issue
It rather looks like you're accessing the session's editing context
from a different thread (long response or so):
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown
Source)
cug
On 07.11.2008, at 16:07, Saad Laassel wrote:
On Oct 9, 2008, at 10:36 AM, Mike Schrag wrote:
One reason why this can happen is an access to an autolocking,
coalescing ERXEC that is in that case the
session().defaultEditingContext() outside the request-response
loop. That means the unlocking code is not called (depends on the
request response loop).
I thought Mike did something to prevent that from happening, but
I'm not totally sure.
I didn't do anything on this one, though I've considered tracking
the creation Thread reference in ERXEC and throwing an exception if
it's used in any other Thread .... It's a bit draconian, though.
ms
We are seeing the same type of error:
Is it possible that a call to ERXEC.newEditingContext(); and a call
to the session's defaultEditingContext return the same exact editing
Context?
this is the error we are seeing:
228054 [WorkerThread5] WARN er.extensions.eof.ERXEC - 15484314
Attempting to lock editing context from WorkerThread5 that was
previously locked in Thread-8
Current stack trace: java.lang.Exception: Locked
at er.extensions.eof.ERXEC.lock(ERXEC.java:448)
at
com.webobjects.appserver.WOSession._awakeInContext(WOSession.java:
835)
at
com
.webobjects
.appserver.WOApplication.restoreSessionWithID(WOApplication.java:
1917)
at
er
.extensions
.appserver.ERXApplication.restoreSessionWithID(ERXApplication.java:
1948)
at
com
.webobjects
.appserver
._private
.WOComponentRequestHandler
._dispatchWithPreparedApplication(WOComponentRequestHandler.java:
324)
at
com
.webobjects
.appserver
._private
.WOComponentRequestHandler
._handleRequest(WOComponentRequestHandler.java:369)
at
com
.webobjects
.appserver
._private
.WOComponentRequestHandler
.handleRequest(WOComponentRequestHandler.java:445)
at
com
.webobjects
.appserver.WOApplication.dispatchRequest(WOApplication.java:1687)
at
er
.extensions
.appserver
.ERXApplication.dispatchRequestImmediately(ERXApplication.java:1657)
at
er
.extensions
.appserver.ERXApplication.dispatchRequest(ERXApplication.java:1621)
at
com
.webobjects
.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:144)
at
com
.webobjects
.appserver._private.WOWorkerThread.run(WOWorkerThread.java:226)
at java.lang.Thread.run(Thread.java:613)
Lock count: 1
Existing lock: java.lang.Exception: Locked
at er.extensions.eof.ERXEC.lock(ERXEC.java:448)
at
com
.webobjects
.eocontrol.EOEditingContext.tryLock(EOEditingContext.java:
4632)
at
com
.webobjects
.eocontrol
.EOEditingContext._sendOrEnqueueNotification(EOEditingContext.java:
4705)
at
com
.webobjects
.eocontrol.EOEditingContext._globalIDChanged(EOEditingContext.java:
2038)
at sun.reflect.GeneratedMethodAccessor172.invoke(Unknown Source)
at
sun
.reflect
.DelegatingMethodAccessorImpl
.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
com
.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:
122)
at com.webobjects.foundation.NSNotificationCenter
$_Entry.invokeMethod(NSNotificationCenter.java:588)
at
com
.webobjects
.foundation
.NSNotificationCenter.postNotification(NSNotificationCenter.java:
532)
at
com
.webobjects
.foundation
.NSNotificationCenter.postNotification(NSNotificationCenter.java:
562)
at
com
.webobjects
.eocontrol
.EOObjectStoreCoordinator
._globalIDsChangedInSubStore(EOObjectStoreCoordinator.java:698)
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
com
.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:
122)
at com.webobjects.foundation.NSNotificationCenter
$_Entry.invokeMethod(NSNotificationCenter.java:588)
at
com
.webobjects
.foundation
.NSNotificationCenter.postNotification(NSNotificationCenter.java:
532)
at
com
.webobjects
.foundation
.NSNotificationCenter.postNotification(NSNotificationCenter.java:
562)
at
com
.webobjects
.eoaccess.EODatabaseContext.commitChanges(EODatabaseContext.java:
6377)
at
com
.webobjects
.eocontrol
.EOObjectStoreCoordinator
.saveChangesInEditingContext(EOObjectStoreCoordinator.java:386)
at
com
.webobjects
.eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3192)
at er.extensions.eof.ERXEC._saveChanges(ERXEC.java:981)
at er.extensions.eof.ERXEC.saveChanges(ERXEC.java:903)
at
com
.devtest
.services
.tasks
.ContentChangeTaskWrapper
.createAndSaveChanges(ContentChangeTaskWrapper.java:70)
at
com
.devtest
.services.tasks.TaskFactory.generateTaskForType(TaskFactory.java:42)
at
com
.devtest
.services
.tasks
.TaskNotificationCenter
.handleNotification(TaskNotificationCenter.java:70)
at
com
.devtest
.services
.tasks.TaskNotificationCenter.run(TaskNotificationCenter.java:79)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor
$Worker.run(Unknown Source)
at java.lang.Thread.run(Thread.java:613)
Created: java.lang.Exception: Creation
at er.extensions.eof.ERXEC.<init>(ERXEC.java:353)
at er.extensions.eof.ERXEC
$DefaultFactory._createEditingContext(ERXEC.java:1492)
at er.extensions.eof.ERXEC
$DefaultFactory._newEditingContext(ERXEC.java:1455)
at er.extensions.eof.ERXObjectStoreCoordinatorPool
$
MultiOSCFactory
._newEditingContext(ERXObjectStoreCoordinatorPool.java:210)
at er.extensions.eof.ERXObjectStoreCoordinatorPool
$
MultiOSCFactory
._newEditingContext(ERXObjectStoreCoordinatorPool.java:205)
at er.extensions.eof.ERXEC.newEditingContext(ERXEC.java:1540)
at
er
.extensions
.appserver.ERXSession.defaultEditingContext(ERXSession.java:352)
at
com
.devtest.services.application.CVSession.initSession(CVSession.java:
173)
at com.devtest.admin.Main.initSession(Main.java:263)
at com.devtest.admin.Main.checkChain(Main.java:91)
at com.devtest.admin.Main.<init>(Main.java:59)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun
.reflect
.NativeConstructorAccessorImpl
.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun
.reflect
.DelegatingConstructorAccessorImpl
.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at
com
.webobjects
.foundation._NSUtilities.instantiateObject(_NSUtilities.java:614)
at
com
.webobjects
.appserver
._private
.WOComponentDefinition
._componentInstanceInContext(WOComponentDefinition.java:567)
at
com
.webobjects
.appserver
._private
.WOComponentDefinition
.componentInstanceInContext(WOComponentDefinition.java:658)
at
com
.webobjects.appserver.WOApplication.pageWithName(WOApplication.java:
2332)
at
com
.webobjects
.appserver
._private
.WOComponentRequestHandler
._dispatchWithPreparedSession(WOComponentRequestHandler.java:284)
at
com
.webobjects
.appserver
._private
.WOComponentRequestHandler
._dispatchWithPreparedApplication(WOComponentRequestHandler.java:
332)
at
com
.webobjects
.appserver
._private
.WOComponentRequestHandler
._handleRequest(WOComponentRequestHandler.java:369)
at
com
.webobjects
.appserver
._private
.WOComponentRequestHandler
.handleRequest(WOComponentRequestHandler.java:445)
at
com
.webobjects
.appserver.WOApplication.dispatchRequest(WOApplication.java:1687)
at
er
.extensions
.appserver
.ERXApplication.dispatchRequestImmediately(ERXApplication.java:1657)
at
er
.extensions
.appserver.ERXApplication.dispatchRequest(ERXApplication.java:1621)
at
com
.webobjects
.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:144)
at
com
.webobjects
.appserver._private.WOWorkerThread.run(WOWorkerThread.java:226)
"Thread-8" prio=5 tid=0x01076950 nid=0xa6f200 waiting on condition
[0xf28c0000..0xf28c2bb0]
at sun.misc.Unsafe.park(Native Method)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:
118)
at
java
.util
.concurrent
.locks
.AbstractQueuedSynchronizer
.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:716)
at
java
.util
.concurrent
.locks
.AbstractQueuedSynchronizer
.acquireQueued(AbstractQueuedSynchronizer.java:746)
at
java
.util
.concurrent
.locks
.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:
1076)
at java.util.concurrent.locks.ReentrantReadWriteLock
$NonfairSync.wlock(ReentrantReadWriteLock.java:342)
at java.util.concurrent.locks.ReentrantReadWriteLock
$WriteLock.lock(ReentrantReadWriteLock.java:637)
at
com
.webobjects
.eocontrol.EOSharedEditingContext.lock(EOSharedEditingContext.java:
736)
at
com
.webobjects
.eocontrol.EOEditingContext.lockObjectStore(EOEditingContext.java:
4664)
at
com
.webobjects
.eocontrol.EOEditingContext.refaultObject(EOEditingContext.java:
4000)
at er.extensions.eof.ERXEC.refaultObject(ERXEC.java:1098)
at
com
.webobjects
.eocontrol
.EOEditingContext._refaultObjectWithGlobalID(EOEditingContext.java:
3259)
at
com
.webobjects
.eocontrol
.EOEditingContext
._newChangesFromInvalidatingObjectsWithGlobalIDs
(EOEditingContext.java:3485)
at
com
.webobjects
.eocontrol
.EOEditingContext._processObjectStoreChanges(EOEditingContext.java:
3522)
at sun.reflect.GeneratedMethodAccessor165.invoke(Unknown Source)
at
sun
.reflect
.DelegatingMethodAccessorImpl
.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.webobjects.foundation.NSSelector.invoke(NSSelector.java:358)
at
com
.webobjects
.foundation.NSSelector._safeInvokeSelector(NSSelector.java:110)
at
com
.webobjects
.eocontrol
.EOEditingContext._processNotificationQueue(EOEditingContext.java:
4741)
at
com
.webobjects.eocontrol.EOEditingContext.lock(EOEditingContext.java:
4620)
at er.extensions.eof.ERXEC.lock(ERXEC.java:480)
at
com
.webobjects
.eocontrol.EOEditingContext.tryLock(EOEditingContext.java:
4632)
at
com
.webobjects
.eocontrol
.EOEditingContext._sendOrEnqueueNotification(EOEditingContext.java:
4705)
at
com
.webobjects
.eocontrol.EOEditingContext._globalIDChanged(EOEditingContext.java:
2038)
at sun.reflect.GeneratedMethodAccessor172.invoke(Unknown Source)
at
sun
.reflect
.DelegatingMethodAccessorImpl
.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
com
.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:
122)
at com.webobjects.foundation.NSNotificationCenter
$_Entry.invokeMethod(NSNotificationCenter.java:588)
at
com
.webobjects
.foundation
.NSNotificationCenter.postNotification(NSNotificationCenter.java:
532)
at
com
.webobjects
.foundation
.NSNotificationCenter.postNotification(NSNotificationCenter.java:
562)
at
com
.webobjects
.eocontrol
.EOObjectStoreCoordinator
._globalIDsChangedInSubStore(EOObjectStoreCoordinator.java:698)
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
com
.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:
122)
at com.webobjects.foundation.NSNotificationCenter
$_Entry.invokeMethod(NSNotificationCenter.java:588)
at
com
.webobjects
.foundation
.NSNotificationCenter.postNotification(NSNotificationCenter.java:
532)
at
com
.webobjects
.foundation
.NSNotificationCenter.postNotification(NSNotificationCenter.java:
562)
at
com
.webobjects
.eoaccess.EODatabaseContext.commitChanges(EODatabaseContext.java:
6377)
at
com
.webobjects
.eocontrol
.EOObjectStoreCoordinator
.saveChangesInEditingContext(EOObjectStoreCoordinator.java:386)
at
com
.webobjects
.eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3192)
at er.extensions.eof.ERXEC._saveChanges(ERXEC.java:981)
at er.extensions.eof.ERXEC.saveChanges(ERXEC.java:903)
at
com
.devtest
.services
.tasks
.ContentChangeTaskWrapper
.createAndSaveChanges(ContentChangeTaskWrapper.java:70)
at
com
.devtest
.services.tasks.TaskFactory.generateTaskForType(TaskFactory.java:42)
at
com
.devtest
.services
.tasks
.TaskNotificationCenter
.handleNotification(TaskNotificationCenter.java:70)
at
com
.devtest
.services
.tasks.TaskNotificationCenter.run(TaskNotificationCenter.java:79)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor
$Worker.run(Unknown Source)
at java.lang.Thread.run(Thread.java:613)
"WorkerThread5" prio=5 tid=0x0104a500 nid=0xa5d200 waiting on
condition [0xf1eae000..0xf1eaebb0]
at sun.misc.Unsafe.park(Native Method)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:
118)
at
java
.util
.concurrent
.locks
.AbstractQueuedSynchronizer
.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:716)
at
java
.util
.concurrent
.locks
.AbstractQueuedSynchronizer
.acquireQueued(AbstractQueuedSynchronizer.java:746)
at
java
.util
.concurrent
.locks
.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:
1076)
at java.util.concurrent.locks.ReentrantLock
$NonfairSync.lock(ReentrantLock.java:184)
at
java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:
256)
at
com
.webobjects.eocontrol.EOEditingContext.lock(EOEditingContext.java:
4617)
at er.extensions.eof.ERXEC.lock(ERXEC.java:480)
at
com.webobjects.appserver.WOSession._awakeInContext(WOSession.java:
835)
at
com
.webobjects
.appserver.WOApplication.restoreSessionWithID(WOApplication.java:
1917)
at
er
.extensions
.appserver.ERXApplication.restoreSessionWithID(ERXApplication.java:
1948)
at
com
.webobjects
.appserver
._private
.WOComponentRequestHandler
._dispatchWithPreparedApplication(WOComponentRequestHandler.java:
324)
at
com
.webobjects
.appserver
._private
.WOComponentRequestHandler
._handleRequest(WOComponentRequestHandler.java:369)
at
com
.webobjects
.appserver
._private
.WOComponentRequestHandler
.handleRequest(WOComponentRequestHandler.java:445)
at
com
.webobjects
.appserver.WOApplication.dispatchRequest(WOApplication.java:1687)
at
er
.extensions
.appserver
.ERXApplication.dispatchRequestImmediately(ERXApplication.java:1657)
at
er
.extensions
.appserver.ERXApplication.dispatchRequest(ERXApplication.java:1621)
at
com
.webobjects
.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:144)
at
com
.webobjects
.appserver._private.WOWorkerThread.run(WOWorkerThread.java:226)
at java.lang.Thread.run(Thread.java:613)
Thanks,
Saad
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden