Re: Do i need to lock getting EODatabaseContext's snapshotForGlobalID() ?
Re: Do i need to lock getting EODatabaseContext's snapshotForGlobalID() ?
- Subject: Re: Do i need to lock getting EODatabaseContext's snapshotForGlobalID() ?
- From: Chuck Hill <email@hidden>
- Date: Mon, 7 Jan 2008 20:57:36 -0800
On Jan 7, 2008, at 8:31 PM, Peter Vandoros wrote:
Hi Chuck,
Chuck Hill wrote:
I thought that we _always_ need to lock the
EOObjectStoreCoordinator and EODatabaseContext even if we have
already locked the EOEditingContext because other
EOEditingContext's could be accessing the them at the same time on
a different Thread. Isn't this correct or is this a special
exception to the rule?
You need to lock it if you are going to call methods on it. There
are probably some safe methods, but I'd rather lock. In your code
above, you do need to lock the context around the
snapshotForGlobalID call.
I thought so.
:-)
Do you think i need to add locking the EODatabaseContext if i have
already locked the EOObjectStoreCoordinator? (I noticed in
EODatabaseContextAdditions that you don't)
No. Locking the EOObjectStoreCoordinator locks everything below it
(i.e. EODatabaseContext, EODatabase).
On a side note, I noticed you (or Pierre; i'm not sure who wrote
that method) are doing the same thing as i am doing without locking
either EOObjectStoreCoordinator or EODatabaseContext in
com.webobjects.eoaccess.utilities.Utilities.faultForSupposedPrimaryKey
Value().
Where is that method from? I don't see it.
Chuck
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
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