Re: Locking editing contexts
Re: Locking editing contexts
- Subject: Re: Locking editing contexts
- From: Chuck Hill <email@hidden>
- Date: Wed, 9 Mar 2005 12:10:08 -0800
On Mar 9, 2005, at 5:57 AM, Kamal Shah wrote:
Hi all,
A basic question - I've read in many places that editing contexts
should be locked and unlocked to prevent deadlocks and data
inconsistency.
Editing contexts should be locked and unlocked to prevent data
inconsistency. Editing contexts should be locked and unlocked
_correctly_ to prevent deadlock.
Is there a more specific explanation of "deadlock and data
inconsistency" as to why these are caused if you don't lock apart from
in the case of multi threading and invalidateAllObjects. Is there any
other reason?
Deadlock is rather a large topic and there are many reasons that it can
happen, most of which are traceable to your code. The "why" of data
inconsistency has to do with notifications, but the why is kind of
irrelevant. It happens, lock and avoid it. Java apps are _always_
multithreaded. It is _always_ an issue. Concurrently dispatching
requests just makes it more of an issue more often.
Chuck
--
Practical WebObjects - a book for intermediate WebObjects developers
who want to increase their overall knowledge of WebObjects, or those
who are trying to solve specific application development 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