Hi OC, The rule is never access an EO from another thread without locking its EC before. Doing an localInstance of-in require accessing the EO and can cause locking problems if locking is not done properly (hard).
Pass EOGlobalIDs to others thread instead of EOs and you will never have strange locking problem. To convert EOs <-> GlobalIDs, ERXEOControlUtilities.globalIDsForObjects(...) and ERXEOControlUtilities.objectsForGlobalIDs(...) are very helpful. BTW, those are very fast to execute. Regards, Samuel > Le 26 oct. 2024 à 10:36, ocs--- via Webobjects-dev > <webobjects-dev@lists.apple.com> a écrit : > > Hi there, > > from inside of a R/R, I need to do something (essentially just log out some > attributes; no changes) with some objects of other editing contexts. > > To prevent deadlocks, of course I cannot lock those other ECs. Since an > attribute access does lock, I am using localInstanceIn, essentially like this: > > === > for (ERXEC otherEC in listOfOtherECs) { // works all right, my method > listOfOtherECs never fails > def otherEO=neededEOInEC(otherEC) // works all right, my method neededEOInEC > never fails and returns an EO in otherEC > def myEO=otherEO.localInstanceIn(session.defaultEditingContext) > ... work with myEO as needed ... > } > === > > The catch is, localInstanceIn locks, too, and thus I _do_ get the deadlocks > which I needed to prevent :( > > Is there a way to dodge the darned locking of the other ECs? > > Thanks, > OC > > _______________________________________________ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com > > This email sent to sam...@samkar.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com