Re: Temporarily Refusing New Sessions
Re: Temporarily Refusing New Sessions
- Subject: Re: Temporarily Refusing New Sessions
- From: Chuck Hill <email@hidden>
- Date: Fri, 5 Nov 2004 09:55:24 -0800
Hi Ian,
On Nov 5, 2004, at 9:04 AM, email@hidden wrote:
I'm looking for a way to temporarily refuse sessions on an instance
while it
performs a CPU intensive task.
I'm not clear on what you are after. Do you want to refuse new
sessions (while continuing to process the ones that have been
created), or do you want to refuse all _requests_? What problems are
you having when this CPU intensive tasks is executing? Unless your app
is only using sessionless direct actions, you can't refuse all requests
as no other instance has the session to handle a session based request.
You can queue them up, but the frameworks already do that, so it seems
that is not a solution acceptable to you.
It doesn't look like
WOApplication.refuseNewSessions() will work, since that will cause the
application to terminate if the number of sessions falls below
MinimumActiveSessions (currently set to 0). Is there a way to have an
instance
refuse new sessions without terminating?
Rather than fixating on this solution, which to be honest does not look
like it is going to be a fruitful path, why not return to the problem
and see other solutions? You have a CPU intensive task. Is it causing
other users to get error messages when it is running? Is it running
too slowly? The former is best solved by spinning off a thread and
running the CPU intensive task in the background. The latter is
possibly best addressed by wrapping the information needed to run the
task in an object and saving to the database. Then have another
application, like daemon, then watches the database for these tasks and
runs them. You can add an e-mail notification at the end of the task
if they are being done for a user.
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