Re: Bug in client side EOF locking?
Re: Bug in client side EOF locking?
- Subject: Re: Bug in client side EOF locking?
- From: Stamenkovic Florijan <email@hidden>
- Date: Wed, 28 Jan 2009 11:10:28 -0400
On Jan 27, 2009, at 19:44, Chuck Hill wrote:
This happens while I have two threads doing some work. One is
performing calculations, the other is updating the GUI. Both of
them are accessing the same EOs, asking them for data.
That sounds problematic. Usually one thread would hold the EC lock
and only that thread would touch the EOs.
Well, I've synchronized access to all the methods in my EC
(synchronizing on the default parent object store object, to avoid
some deadlocks, which are JC specific I believe), and till now that
seemed sufficient, it solved all the locking issues I had so far
encountered...
2. EOCustomObject.willReadRelationship is calling
"unlockObjectStore(...)" while the thread this is happening on does
not actually own the lock in the EODistributedObjectStore... To me
this looks like a bug outside the scope of my code. Or am I missing
something?
It will lock the object store to fire a fault for the relationship.
Then it will unlock it. Perhaps both threads were firing faults at
the same time?
They are, guaranteed. But they should synchronize between
themselves... I thought that was what locking the object store was all
about...
Also, when I look at the source of ReentrantLock, I see that this
exception is thrown because of:
if (Thread.currentThread() != owner)
throw new IllegalMonitorStateException();
So, the thread trying to unlock does not actually own the lock, the
other thread owns it. AFAIK the only way to make this happen is
calling unlock, without the same thread obtaining a lock before that.
Which is most definitively a bug. Or do I see this wrong?
This is one of those situations in which being able to see WO source
would really make life easier :)
3. Ideas, suggestions (bug reporting aside)?
EOF does not really like more than one thread accessing EOs at one
time. Can you use two sets of EOs in different editing contexts?
Post notifications from the thread doing the calculations?
Hm, I can fix this particular situation quite easily (make the thread
that is calculating stuff fire all the faults that the other thread
would normally fire). I am more interested in the principle of
things... So, what is the end verdict? Report a bug? Avoid more then
one thread doing EO work?
Thanks,
F
_______________________________________________
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