-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: advanced long tx pattern with redirects vs. forwards
PostPosted: Sun Jul 02, 2006 10:11 am 
Regular
Regular

Joined: Thu Sep 16, 2004 4:56 pm
Posts: 80
I started using the long application tx. pattern a while ago and am now starting to understand enough to ask a few detailed questions I can't find elsewhere. I believe the redirect functionality does not work too well with this pattern.

First take a look at two scenarios. One is the forward
1. Request comes in through filter, hibernate session starts
2. request results in JSF action method being called
3. JSF action method flags to end the conversation(long tx pattern default is to continue it)
4. JSF calls into next Form page which may load new database objects, etc. etc.
5. goes back through filter which actually ends the conversation based on the flag being set so there is no outstanding conversation which I want in this case!!!!!

That worked wonderfully, but here is what happens in a redirect even though I would want the same behavior as above......
1. Request comes in through filter, hibernate session starts
2. request results in JSF action method being called.
3. JSF action method flags to end the conversation(the default would be to continue)
4. since redirect, goes back up through filter and conversation is over
5. new request caused by redirect comes in
6. starts a new conversation
7. JSF calls the same methods in #4 for forwards to render the next page
8. conversation is left open because no action methods are called on a redirect the second time and default is to leave conversation open.


Basically, I want to make sure redirect and forward have the same functionality.....ie, the conversation should be left open on steps 3, 4, 5, 6 in the redirect case.....The flag to end the conversation should not have happened until step #8 when it should be closed so forward and redirect operate the same. Maybe, the filter should check if it is a redirect or not first and save the end conversation flag for later instead of the code I read from CaveatEmptor??????

Lastly, what is with the default behavior of continue conversation. I user to have action="someAction" in alot of my jsp code but since the default was to end the conversation, I have been going through that code and having to call action="#{bean.someAction}" just so I could make the conversation end.

thoughts?
thanks,
dean


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.