Re: Allows Concurrent Request Documentation
Re: Allows Concurrent Request Documentation
- Subject: Re: Allows Concurrent Request Documentation
- From: Jonathan Rochkind <email@hidden>
- Date: Mon, 12 Apr 2004 10:53:48 -0500
At 11:05 AM -0400 4/12/04, Jacky Gagnon wrote:
Hi, Jonathan
If I understand, if each users connected to my app have their
session, I don't need to worry about locking objects in
defaultEditingContext? Whats about some method, like
invalidateAllObjects, who can propagate to every EditingContext?
The reason you don't need to worry about locking/unlocking the
default editing context is simply because the WO framework does it
for you---locks it at the beginning of a request-response loop,
unlocks it at the end. If you are using the default editing context
somewhere outside a request-response loop (for instance, in a
WOLongResponsePage; although that doesn't work well for other
reasons) you would need to lock it yourself.
--Jonathan
If I must lock and unlock objects, whats the best strategy?
Thanks!
Jacky :-)
Le 04-04-08, ` 17:29, Jonathan Rochkind a icrit :
I don't know if there's any documentation anywhere, but basically
you've just got to make sure all your code is thread safe (which it
should have been already, but now it's even more important).
Since access to a given session can still only be given to one
request at a time, you really only need to worry about things
"above" the level of session. Basically, anything stored in a
variable in Application, or in a static variable in some class.
You've got to make sure access to all that stuff is thread-save,
use 'synchronized' keyword to ensure thread safe access to
variables, etc.
I just did this, and it worked fine for me, I didn't have any
problems. I just made sure to synchronize access to static
variables and iVars in Application.
--Jonathan
At 4:55 PM -0400 4/8/04, Jacky Gagnon wrote:
Hi,
Where I can find documentation about allowing concurrent request
handling in WOApplication?
I'm not sure what to change in my code when I put this option to true.
Thanks!
Jacky :-)
_______________________________________________
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.
_______________________________________________
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.