Re: Refusing New Connections as well as New Instances

Chuck Hill <[email protected]> Tue, 12 Oct 2004 20:21:42 -0700
Newsgroups gmane.comp.web.webobjects.admin
Message-ID <[email protected]>
Hi Ken,

On Oct 12, 2004, at 10:06 AM, Ken Schweigert wrote:

> We have an app that is deployed that is both session based and direct
> action based.  When a new version of this app needs to be launched I
> refuse new sessions via Monitor and wait for the instances to stop.
> Occasionally an instance will stay alive and create new sessions, even
> with it refusing new ones.  We believe it's caused a visitor who hits
> a direct action to a refusing instance who then is able to create a
> session.
>
That is correct.  This is usually the result of their browser having an 
old instance ID cookie, or the user having bookmarked or otherwise 
retained a direct action URL that was generated with an instance number 
in it (which is what happens after a session is created).


> Is it possible to refuse both new sessions and new connections to an
> instance while still allowing established sessions to continue making
> connections?
>
>
There is no provision in the frameworks to handle this.  Or least there 
was not the last time I was bitten by this.  What I did was to override 
dispatchRequest in Application to detect a sessionless, direct action 
request when the app was refusing new requests.  The URL is then 
stripped of the instance number (and / or the cookie expired) and a 
redirect to the stripped URL returned to the browser.  This way new 
requests are handled, no sessions are created, and the user gets where 
they were going transparently.

Chuck