AjaxUpdateContainer successive updates + Deadlock
AjaxUpdateContainer successive updates + Deadlock
- Subject: AjaxUpdateContainer successive updates + Deadlock
- From: Paul Stringer <email@hidden>
- Date: Mon, 09 Mar 2009 13:07:31 +0100
I'm struggling here with a deadlock situation that as far as I can see
is caused by Ajax Updates. What I've done so far. Removed any traces
of a shared editing context from my app to count that out. I've double
checked my Wonder autolocking properties which are as below and double
checked I only use ERXEC.newEditingContext() with not a
defaultEditingContext() in sight.
er.extensions.ERXApplication.useEditingContextUnlocker = true
er.extensions.ERXEC.defaultAutomaticLockUnlock = true
er.extensions.ERXEC.defaultCoalesceAutoLocks = true
er.extensions.ERXEC.useSharedEditingContext = false
The debug below leads up to the deadlock. They are always triggered
when a AjaxUpdateContainer is fired numerous times in succession where
they are in the same session on the same page accessing new EO's - it
can quite happily work for a while but always seems to start getting
very confused after a lot of this kind of abuse. Despite mentions of
other threads in the warnings I don't have any background threads that
I'm explicitly creating myself.
Any suggestions of things I can try appreciated before I give up and
rip the thing out and replace it with something more boring.
So things running smoothly then a bunch of AjaxUpdateContainer Updates
in succession then.....
Mar 08 22:49:59 SMS[????] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog -
*** EOEditingContext: access when another thread holds a lock:
_eoForGID()!
java.lang.Exception: This is not a real exception, just a stack trace
of the location of the contested lock:
at
com
.webobjects
.eocontrol
.EOEditingContext
._EOAssertSafeMultiThreadedAccess(EOEditingContext.java:5182)
at
com
.webobjects
.eocontrol
.EOEditingContext
._EOAssertSafeMultiThreadedReadAccess(EOEditingContext.java:5156)
at
com
.webobjects.eocontrol.EOEditingContext._eoForGID(EOEditingContext.java:
2636)
at
com
.webobjects
.eocontrol.EOEditingContext.faultForGlobalID(EOEditingContext.java:3635)
at er.extensions.eof.ERXEC.faultForGlobalID(ERXEC.java:1013)
at
com
.webobjects
.eoaccess
.EODatabaseContext.objectsForSourceGlobalID(EODatabaseContext.java:4044)
at
com
.webobjects
.eocontrol
.EOObjectStoreCoordinator
.objectsForSourceGlobalID(EOObjectStoreCoordinator.java:682)
at
com
.webobjects
.eocontrol
.EOEditingContext.objectsForSourceGlobalID(EOEditingContext.java:3965)
at er.extensions.eof.ERXEC.objectsForSourceGlobalID(ERXEC.java:1070)
at
com
.webobjects
.eoaccess.EODatabaseContext._fireArrayFault(EODatabaseContext.java:4427)
at
com
.webobjects
.eoaccess
.EOAccessArrayFaultHandler
.completeInitializationOfObject(EOAccessArrayFaultHandler.java:70)
at
com
.webobjects
.eocontrol
._EOCheapCopyMutableArray.willRead(_EOCheapCopyMutableArray.java:38)
at
com
.webobjects
.eocontrol
._EOCheapCopyMutableArray.count(_EOCheapCopyMutableArray.java:92)
at er.extensions.foundation.ERXArrayUtilities
$SortOperator.compute(ERXArrayUtilities.java:1018)
at
com
.webobjects
.foundation.NSArray._valueForKeyPathWithOperator(NSArray.java:795)
at com.webobjects.foundation.NSArray.valueForKeyPath(NSArray.java:831)
at com.webobjects.foundation.NSKeyValueCodingAdditions
$Utility.valueForKeyPath(NSKeyValueCodingAdditions.java:149)
at com.webobjects.foundation.NSKeyValueCodingAdditions
$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:
217)
at
com
.webobjects
.eocontrol.EOCustomObject.valueForKeyPath(EOCustomObject.java:1675)
at com.webobjects.foundation.NSKeyValueCodingAdditions
$Utility.valueForKeyPath(NSKeyValueCodingAdditions.java:149)
at com.webobjects.foundation.NSKeyValueCodingAdditions
$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:
217)
at
com.webobjects.appserver.WOComponent.valueForKeyPath(WOComponent.java:
1600)
at
com
.webobjects
.appserver
._private
.WOKeyValueAssociation.valueInComponent(WOKeyValueAssociation.java:46)
at
er
.extensions
.components
._private.ERXWORepetition.createContext(ERXWORepetition.java:334)
at
er
.extensions
.components._private.ERXWORepetition.invokeAction(ERXWORepetition.java:
367)
at
com
.webobjects
.appserver
._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101)
at
com
.webobjects
.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110)
at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:
945)
at
er.extensions.components.ERXComponent.invokeAction(ERXComponent.java:93)
at
com
.webobjects
.appserver
._private.WOComponentReference.invokeAction(WOComponentReference.java:
104)
at
com
.webobjects
.appserver
._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101)
at
er
.extensions
.components
.conditionals
.ERXWOConditional.invokeChildrenAction(ERXWOConditional.java:111)
at
com
.webobjects
.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110)
at
er
.extensions
.components
.conditionals.ERXWOConditional.invokeAction(ERXWOConditional.java:102)
at
com
.webobjects
.appserver
._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101)
at
com
.webobjects
.appserver
._private.WOGenericContainer.invokeAction(WOGenericContainer.java:23)
at
com
.webobjects
.appserver
._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101)
at
com
.webobjects
.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110)
at
com
.webobjects
.appserver
._private.WOComponentContent.invokeAction(WOComponentContent.java:31)
at
com
.webobjects
.appserver
._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101)
at
com
.webobjects
.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110)
at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:
945)
at
com
.webobjects
.appserver
._private.WOComponentReference.invokeAction(WOComponentReference.java:
104)
at
com
.webobjects
.appserver
._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101)
at
com
.webobjects
.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110)
at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:
945)
at
com
.webobjects
.appserver
._private.WOComponentReference.invokeAction(WOComponentReference.java:
104)
at
com
.webobjects
.appserver
._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101)
at
com
.webobjects
.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110)
at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:
945)
at com.webobjects.appserver.WOSession.invokeAction(WOSession.java:1168)
at
com.webobjects.appserver.WOApplication.invokeAction(WOApplication.java:
1375)
at
er
.extensions
.appserver
.ajax.ERXAjaxApplication.invokeAction(ERXAjaxApplication.java:48)
at
er
.extensions.appserver.ERXApplication.invokeAction(ERXApplication.java:
1539)
at
com
.webobjects
.appserver
._private
.WOComponentRequestHandler
._dispatchWithPreparedPage(WOComponentRequestHandler.java:196)
at
com
.webobjects
.appserver
._private
.WOComponentRequestHandler
._dispatchWithPreparedSession(WOComponentRequestHandler.java:287)
at
com
.webobjects
.appserver
._private
.WOComponentRequestHandler
._dispatchWithPreparedApplication(WOComponentRequestHandler.java:322)
at
com
.webobjects
.appserver
._private
.WOComponentRequestHandler
._handleRequest(WOComponentRequestHandler.java:358)
at
com
.webobjects
.appserver
._private
.WOComponentRequestHandler
.handleRequest(WOComponentRequestHandler.java:435)
at er.ajax.AjaxRequestHandler.handleRequest(AjaxRequestHandler.java:17)
at
com
.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java:
1306)
at
er
.extensions
.appserver
.ERXApplication.dispatchRequestImmediately(ERXApplication.java:1656)
at
er
.extensions
.appserver.ERXApplication.dispatchRequest(ERXApplication.java:1620)
at
com
.webobjects
.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:173)
at
com
.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java:
254)
at java.lang.Thread.run(Thread.java:613)
Mar 08 22:49:59 SMS[????] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog -
*** EODatabaseContext: access without lock!
java.lang.Exception: This is not a real exception, just a stack trace
of the location of the missing lock:
at
com
.webobjects
.eoaccess
.EODatabaseContext
._EOAssertSafeMultiThreadedAccess(EODatabaseContext.java:4452)
at
com
.webobjects
.eoaccess.EODatabaseContext.ownsGlobalID(EODatabaseContext.java:5718)
at
com
.webobjects
.eocontrol
.EOObjectStoreCoordinator
.objectStoreForGlobalID(EOObjectStoreCoordinator.java:235)
at
com
.webobjects
.eocontrol
.EOObjectStoreCoordinator.refaultObject(EOObjectStoreCoordinator.java:
697)
at
com
.webobjects
.eocontrol.EOEditingContext.refaultObject(EOEditingContext.java:4009)
at er.extensions.eof.ERXEC.refaultObject(ERXEC.java:1098)
at
com
.webobjects
.eocontrol.EOEditingContext.refaultObject(EOEditingContext.java:4062)
at er.extensions.eof.ERXEC.refaultObject(ERXEC.java:1098)
at
com
.webobjects
.eocontrol
.EOEditingContext
._newChangesFromInvalidatingObjectsWithGlobalIDs(EOEditingContext.java:
3520)
at
com
.webobjects
.eocontrol
.EOEditingContext._processObjectStoreChanges(EOEditingContext.java:3558)
at sun.reflect.GeneratedMethodAccessor228.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:354)
at
com
.webobjects.foundation.NSSelector._safeInvokeSelector(NSSelector.java:
108)
at
com
.webobjects
.eocontrol
.EOEditingContext._sendOrEnqueueNotification(EOEditingContext.java:4784)
at
com
.webobjects
.eocontrol
.EOEditingContext._objectsChangedInStore(EOEditingContext.java:3598)
at er.extensions.eof.ERXEC._objectsChangedInStore(ERXEC.java:1285)
at sun.reflect.GeneratedMethodAccessor227.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:
120)
at com.webobjects.foundation.NSNotificationCenter
$_Entry.invokeMethod(NSNotificationCenter.java:601)
at
com
.webobjects
.foundation
.NSNotificationCenter.postNotification(NSNotificationCenter.java:545)
at
com
.webobjects
.foundation
.NSNotificationCenter.postNotification(NSNotificationCenter.java:575)
at
com
.webobjects
.eocontrol
.EOEditingContext._processRecentChanges(EOEditingContext.java:1886)
at
com
.webobjects
.eocontrol.EOEditingContext.processRecentChanges(EOEditingContext.java:
1951)
at er.extensions.eof.ERXEC.processRecentChanges(ERXEC.java:659)
at
com
.webobjects
.eocontrol
.EOEditingContext._processEndOfEventNotification(EOEditingContext.java:
2213)
at
com
.webobjects
.eocontrol
.EOEditingContext._undoManagerCheckpoint(EOEditingContext.java:1956)
at sun.reflect.GeneratedMethodAccessor242.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:
120)
at com.webobjects.foundation.NSNotificationCenter
$_Entry.invokeMethod(NSNotificationCenter.java:601)
at
com
.webobjects
.foundation
.NSNotificationCenter.postNotification(NSNotificationCenter.java:545)
at
com
.webobjects
.foundation
.NSNotificationCenter.postNotification(NSNotificationCenter.java:559)
at
com
.webobjects
.foundation
.NSUndoManager._postCheckpointNotification(NSUndoManager.java:264)
at
com
.webobjects
.foundation.NSUndoManager.endUndoGrouping(NSUndoManager.java:416)
at
com
.webobjects
.foundation
.NSUndoManager._processEndOfEventNotification(NSUndoManager.java:254)
at sun.reflect.GeneratedMethodAccessor304.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:354)
at
com
.webobjects.foundation.NSSelector._safeInvokeSelector(NSSelector.java:
108)
at com.webobjects.foundation.NSDelayedCallbackCenter
$NSLightInvocation.invoke(NSDelayedCallbackCenter.java:242)
at
com
.webobjects
.foundation
.NSDelayedCallbackCenter._eventEnded(NSDelayedCallbackCenter.java:208)
at
com
.webobjects
.foundation
.NSDelayedCallbackCenter.eventEnded(NSDelayedCallbackCenter.java:171)
at
com
.webobjects
.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:184)
at
com
.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java:
254)
at java.lang.Thread.run(Thread.java:613)
It survives this trauma and carries on, warnings come and go in
similar situations before a little later Boom!...
Mar 08 23:09:55 SMS[????] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog -
*** EOEditingContext: access when another thread holds a lock:
_eoForGID()!
Mar 08 23:09:55 SMS[????] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog -
*** EODatabaseContext: access without lock!
.........
Mar 08 23:09:55 SMS[????] (ERXNSLogLog4jBridge.java:43) WARN NSLog -
<WOWorkerThread id=57 socket=Socket[addr=/
127.0.0.1,port=????,localport=????]> Exception occurred while
responding to client: java.lang.IllegalStateException: Illegal Lock
usage: unlocking thread not owner.
java.lang.IllegalStateException: Illegal Lock usage: unlocking thread
not owner.
at
com.webobjects.foundation.NSRecursiveLock.unlock(NSRecursiveLock.java:
207)
at
com
.webobjects
.eocontrol
.EOObjectStoreCoordinator.unlock(EOObjectStoreCoordinator.java:516)
at
com
.webobjects
.eocontrol.EOEditingContext.unlockObjectStore(EOEditingContext.java:
4753)
at
com
.webobjects
.eocontrol.EOEditingContext.refaultObject(EOEditingContext.java:4011)
at er.extensions.eof.ERXEC.refaultObject(ERXEC.java:1098)
at
com
.webobjects
.eocontrol.EOEditingContext.refaultObject(EOEditingContext.java:4062)
at er.extensions.eof.ERXEC.refaultObject(ERXEC.java:1098)
at
com
.webobjects
.eocontrol
.EOEditingContext
._newChangesFromInvalidatingObjectsWithGlobalIDs(EOEditingContext.java:
3520)
at
com
.webobjects
.eocontrol
.EOEditingContext._processObjectStoreChanges(EOEditingContext.java:3558)
at sun.reflect.GeneratedMethodAccessor228.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:354)
at
com
.webobjects.foundation.NSSelector._safeInvokeSelector(NSSelector.java:
108)
at
com
.webobjects
.eocontrol
.EOEditingContext._sendOrEnqueueNotification(EOEditingContext.java:4784)
at
com
.webobjects
.eocontrol
.EOEditingContext._objectsChangedInStore(EOEditingContext.java:3598)
at er.extensions.eof.ERXEC._objectsChangedInStore(ERXEC.java:1285)
at sun.reflect.GeneratedMethodAccessor227.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:
120)
at com.webobjects.foundation.NSNotificationCenter
$_Entry.invokeMethod(NSNotificationCenter.java:601)
at
com
.webobjects
.foundation
.NSNotificationCenter.postNotification(NSNotificationCenter.java:545)
at
com
.webobjects
.foundation
.NSNotificationCenter.postNotification(NSNotificationCenter.java:575)
at
com
.webobjects
.eocontrol
.EOEditingContext._processRecentChanges(EOEditingContext.java:1886)
at
com
.webobjects
.eocontrol.EOEditingContext.processRecentChanges(EOEditingContext.java:
1951)
at er.extensions.eof.ERXEC.processRecentChanges(ERXEC.java:659)
at
com
.webobjects
.eocontrol
.EOEditingContext._processEndOfEventNotification(EOEditingContext.java:
2213)
at
com
.webobjects
.eocontrol
.EOEditingContext._undoManagerCheckpoint(EOEditingContext.java:1956)
at sun.reflect.GeneratedMethodAccessor242.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:
120)
at com.webobjects.foundation.NSNotificationCenter
$_Entry.invokeMethod(NSNotificationCenter.java:601)
at
com
.webobjects
.foundation
.NSNotificationCenter.postNotification(NSNotificationCenter.java:545)
at
com
.webobjects
.foundation
.NSNotificationCenter.postNotification(NSNotificationCenter.java:559)
at
com
.webobjects
.foundation
.NSUndoManager._postCheckpointNotification(NSUndoManager.java:264)
at
com
.webobjects
.foundation.NSUndoManager.endUndoGrouping(NSUndoManager.java:416)
at
com
.webobjects
.foundation
.NSUndoManager._processEndOfEventNotification(NSUndoManager.java:254)
at sun.reflect.GeneratedMethodAccessor304.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:354)
at
com
.webobjects.foundation.NSSelector._safeInvokeSelector(NSSelector.java:
108)
at com.webobjects.foundation.NSDelayedCallbackCenter
$NSLightInvocation.invoke(NSDelayedCallbackCenter.java:242)
at
com
.webobjects
.foundation
.NSDelayedCallbackCenter._eventEnded(NSDelayedCallbackCenter.java:208)
at
com
.webobjects
.foundation
.NSDelayedCallbackCenter.eventEnded(NSDelayedCallbackCenter.java:171)
at
com
.webobjects
.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:184)
at
com
.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java:
254)
at java.lang.Thread.run(Thread.java:613)
tia
Paul - Treasuremytext.com
_______________________________________________
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