Re: WOJC Thread-Problem... makes me crazy
Re: WOJC Thread-Problem... makes me crazy
- Subject: Re: WOJC Thread-Problem... makes me crazy
- From: Nick Pilch <email@hidden>
- Date: Thu, 8 Jan 2004 10:30:39 -0800
I have found that the implementation of the server code to handle
client requests is not thread-safe. However, this only manifested
itself if I was handling multiple client requests at the same time
(WOAllowsConcurrentRequestHandling = true). I suggest that you at
least set this to false.
Perhaps you will need to either give the client WOSession or your
"TimerThread" a separate EOF stack or serialize your thread with the
handling of client requests. Although EOF is supposedly thread-safe
(with proper locking), I find that the safest route is to use a
separate EOF per thread.
At 6:41 AM +0100 1/8/04, Oliver Leu wrote:
Dear list
WO5.2 Mac OSX 10.2, Non-Direct2JavaClient with InterfaceBuilder.
I added a "TimerThread" to my server.
That thread scans every 30 seconds an directory on the server.
If my thread finds some information in the directory, the thread does a lot
of operations like parsing files, serializing objects, writing them to disk,
write some
informations to the DB (openbase) using EOF.
And it works!
BUT...
In case a client accesses the DB (ec), the serverthread doesn't the work
anymore!
No, error-mess., no exception, nothing.
Eventually I produced a deadlock? But I'm not experienced in
thread-programming.
I also tried to lock the ec [lock(), unlock()], but without a resultat.
On serverside I get the ec via:
Session session= new Session();
ec = session.defaultEditingContext();
I assume that the mistake is "around wrong handling of editing context"?!
Thanks for your help.
Oliver
***
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
--
Nick Pilch / email@hidden
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.