• 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: Object Store Coordinator and User Info – Is this Dangerous?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Object Store Coordinator and User Info – Is this Dangerous?


  • Subject: Re: Object Store Coordinator and User Info – Is this Dangerous?
  • From: Andrew Lindesay <email@hidden>
  • Date: Wed, 29 Oct 2008 13:51:20 +1300

Hello Chuck;

Define safe. ec.lock() does not lock the root object store, so other ec's can also set / clear foobar while you are in this code.

Thanks; I take back what I said to Peter just then!

Safe... I guess I mean no bad concurrent things happening to the OSC. I guess this is going to get a bit mucky. I guess the following would work because the locks in the object stores are re-entrant locks as far as I can remember...



  ec.lock();

  try
  {
    EOObjectStore ros = ec. rootObjectStore();

    ros.lock();

    try
    {
      ros.setUserInfoForKey(xyz,"foobar");

try
{
// do some editing context foo here!
}
finally { ec.rootObjectStore().setUserInfoForKey(null,"foobar"); }
}
finally { ros.unlock(); }
}
finally { ec.unlock(); }


cheers.

___
Andrew Lindesay
www.lindesay.co.nz

_______________________________________________
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


  • Follow-Ups:
    • Re: Object Store Coordinator and User Info – Is this Dangerous?
      • From: Chuck Hill <email@hidden>
References: 
 >Object Store Coordinator and User Info – Is this Dangerous? (From: Andrew Lindesay <email@hidden>)
 >Re: Object Store Coordinator and User Info – Is this Dangerous? (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: Object Store Coordinator and User Info – Is this Dangerous?
  • Next by Date: Re: Object Store Coordinator and User Info – Is this Dangerous?
  • Previous by thread: Re: Object Store Coordinator and User Info – Is this Dangerous?
  • Next by thread: Re: Object Store Coordinator and User Info – Is this Dangerous?
  • Index(es):
    • Date
    • Thread