Re: SharedEditingContext Write Locks?
Re: SharedEditingContext Write Locks?
- Subject: Re: SharedEditingContext Write Locks?
- From: Dov Rosenberg <email@hidden>
- Date: Thu, 17 Nov 2005 21:35:27 -0500
- Thread-topic: SharedEditingContext Write Locks?
We have been looking deeper into our problems based on all of the
information provided on the newslist. It has been very helpful in
understanding what is happening. Here is the crux of our issue (now that I
understand what is happening)
Our application has 2 parts. One part (the mgmt console) runs in a separate
JVM from the other. The mgmt console creates and modifies data all the time.
The other half is primarily read only. We use the same EOModel for both
applications. Both apps are deployed as servlets.
The read-only application does create dynamic SQL statements with
EOQualifers and EOFetchSpecifications (we don't have any defined in our
model - all dynamically created based on the user information, security,
etc).
We use the SharedEditingContext (SEC) in the readonly app. We use regular
editing contexts for processing forms that create or change data. We have
set the sharedEditingContext reference to NULL on the regular editing
contexts.
For the SEC we do things like:
sec.objectsForFetchSpecification(...)
Which appears to be causing our locking problem under load.
According to what I have learned - objectsForFetchSpecification() will cause
the SEC to get a write lock in order to update its state. It can not get a
write lock until all of the read locks have been released.
Under load conditions there are readers all the time and the write lock can
not be obtained.
It seems that calling objectsForFetchSpecification() to either fetch data
into the shared editing context or to refresh it too often is a bad thing.
When multiple threads are trying to do the same operation - the EOF deadlock
occurs.
It is not practical for us to try to prefetch all of the data into the SEC.
There can be thousands or more objects in the database.
Can anyone think of a reasonable strategy? Besides dumping EOF and using
JDBC.
Thanks in advance
--
Dov Rosenberg
Conviveon/Inquira
Knowledge Management Experts
http://www.conviveon.com
http://www.inquira.com
_______________________________________________
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