• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: EC's and locks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EC's and locks


  • Subject: Re: EC's and locks
  • From: Greg Hulands <email@hidden>
  • Date: Thu, 7 Oct 2004 08:32:12 +1000

Thanks for the reply. The reason I didn't do the locking was because the ERXEC docs say

"Subclass that has every public method overridden to support automatic lock/unlock handling for you. This is very useful, as is is potentially very dangerous to rely on EOFs automatic lock handling - it will invariably lead into deadlocks."

Which gives me the impression I didn't need to.


Thanks again. Greg

On 06/10/2004, at 9:18 PM, David Teran wrote:

In my application I'm using the ER extensions. I have in my application class an array of EO's that store the preferences in the database. Whenever I modify a preference I am getting a heap of these messages in the log:

2004-10-06 14:18:22,054 WARN ShoeBox[13502:50212 2] LockLogger (ERXEC.java:251) - called method insertedObjects without a lock, ec=er.extensions.ERXEC@d1cd90
2004-10-06 14:18:22,057 WARN ShoeBox[13502:50212 2] LockLogger (ERXEC.java:251) - called method insertedObjects without a lock, ec=er.extensions.ERXEC@d1cd90
2004-10-06 14:18:22,060 WARN ShoeBox[13502:50212 2] LockLogger (ERXEC.java:251) - called method globalIDForObject without a lock, ec=er.extensions.ERXEC@d1cd90


The preferences are part of a shared editing context, so I'm not sure if this is why the messages are coming up.
public void savePreferences() {
EOSharedEditingContext sec = EOSharedEditingContext.defaultSharedEditingContext();
EOFetchSpecification fs = EOModelGroup.defaultGroup().fetchSpecificationNamed("All Prefs", "Preferences");
sec.bindObjectsWithFetchSpecification(fs, "All Prefs");
preferences = EOUtilities.objectsForEntityNamed(sec, "Preferences");
}





public static Preferences localCopyOfPreference(Preferences pref) {
EOEditingContext ec = ERXEC.newEditingContext();
ec.lock();
try {
ec.setSharedEditingContext(null);
Preferences localPref = (Preferences)EOUtilities.localInstanceOfObject(ec, pref);
} finally {
ec.unlock();
}
return localPref;
}



regards David



_______________________________________________ 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
References: 
 >EC's and locks (From: Greg Hulands <email@hidden>)
 >Re: EC's and locks (From: David Teran <email@hidden>)

  • Prev by Date: Re: Question about java method calling
  • Next by Date: Re: Question about java method calling
  • Previous by thread: Re: EC's and locks
  • Next by thread: No more evaluation license keys?
  • Index(es):
    • Date
    • Thread