Re: [Webware-discuss] forward() and Session mgmt

2007-12-17 Thread Chuck Esterbrook
On Dec 17, 2007 12:31 PM, Ben Parker <[EMAIL PROTECTED]> wrote:
> Hey all -
>
> Calls to forward() will invoke the complete awake/respond/sleep cycle
> within the outer awake/respond/sleep cycle of the parent transaction.
> This means that if a servlet forwards a request to another servlet, then
> the session will be awakened twice and put to sleep twice (or more
...
> Has anyone else encountered this? Do you think it's an issue to be
> handled within Webware or left up to the application developer?

The current behavior hasn't caused problems for me, but I can
certainly see how it could as you describe above. My opinion is that
your solution should be inside Webware because eventually others will
have the same problem and its doubtful that anyone needs the redundant
calls. Also, we could offer a setting or at least a class level
variable somewhere to turn it off.

-Chuck

-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Webware-discuss mailing list
Webware-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-discuss


[Webware-discuss] forward() and Session mgmt

2007-12-17 Thread Ben Parker
Hey all -

Calls to forward() will invoke the complete awake/respond/sleep cycle 
within the outer awake/respond/sleep cycle of the parent transaction. 
This means that if a servlet forwards a request to another servlet, then 
the session will be awakened twice and put to sleep twice (or more 
depending on the number of forward calls). This was causing some issues 
in our application because we use database sessions, but it would apply 
to anyone using the SessionFileStore as well.

The issue is that the session is saved after every forward call, and 
might not be in an appropriate state to start another transaction, but 
another request can come in before the parent transaction puts the 
session to sleep for the final time (e.g. user with two browsers open, 
or double-clicking, etc). I have handled this in our application by 
keeping an "awakened" count on the session object, and ensuring that the 
session is only put to sleep when the awakened count is 0, e.g. when the 
final sleep() has been called.

It would be pretty straightforward to integrate the awakened count into 
Webware's default session management options, but that would be changing 
functionality. I can't see how anyone would be relying on the current 
behavior, but you never know ...

Has anyone else encountered this? Do you think it's an issue to be 
handled within Webware or left up to the application developer?

Regards - Ben

-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Webware-discuss mailing list
Webware-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-discuss