Attached diff is the new solution I have in my mind now. That is,
request is being tracked right from where the pageflow is removed from
session using the SessionBindingEvent. At the destroy method if request
is available, context is created or else onDestroy(session) is called
without context.
But I feel, with this approach, customers would not be certain about the
context being associated with onDestroy(session). If session
invalidation occurs, onDestroy(session) will be called without context.
So to overcome this, I feel, a new callback onDestroy(request, session)
is required here. Does this sound reasonable? Or if there is a way in
which I can create control container context without requiring "request"
object, please let me know.
regards,
~Poorna
-----Original Message-----
From: Carlin Rogers
Sent: Wednesday, December 12, 2007 11:13 AM
To: Poorna Ramasamy
Cc: Scott L'Hommedieu; Scott Roberts; Ashish Mahendru; Ginny Peterson
Subject: Re: reg. CR354242 (BEEHIVE-1094)
Yes, you're correct Poorna. The page flow controller onDestroy() method
can get called by either a session invalidation or via the framework for
a request to leave a page flow and go to another page flow (does not
have to be nested though). I'll also think about this some more.
Carlin
Poorna Ramasamy wrote:
> Yes, I am also not in favor of one-off patch for this. The main issue
> here is that there is no request object associated with pageflow
> onDestroy since I think this can come from session invalidation as
well.
> Though in this case, pageflow is destroyed from a user request
> navigating from nested pageflow to parent pageflow. If this needs to
be
> fixed cleanly, may be the source for pageflow destruction (whether
thru
> a request or session invalidation, etc) needs to be maintained, and
> delegated till destroy() method of PageFlowManagedObject. I will do
some
> more investigation and discuss with Carlin if required and will update
> on this.
>
>
> regards,
> ~Poorna
>
>
>
> -----Original Message-----
> From: Scott L'Hommedieu
> Sent: Wednesday, December 12, 2007 10:39 AM
> To: Carlin Rogers; Poorna Ramasamy
> Cc: Scott Roberts; Ashish Mahendru; Ginny Peterson
> Subject: RE: reg. CR354242 (BEEHIVE-1094)
>
> A one off patch of code we won't be putting into future releases is
> against our standard policy in CCE.
>
> This is a hot issue but we (Poorna) can keep working it until an
> adequate solution is reached. That really helps the customer more
than
> giving them code with potentially more bugs of unknown magnitude.
>
> Hopefully there will be a bit more input from the dev list.
>
> Thanks for taking this on Carlin.
>
> Scott
>
> -----Original Message-----
> From: Carlin Rogers
> Sent: Tuesday, December 11, 2007 9:45 PM
> To: Poorna Ramasamy
> Cc: Scott L'Hommedieu; Scott Roberts; Ashish Mahendru; Ginny Peterson
> Subject: Re: reg. CR354242 (BEEHIVE-1094)
>
> Hi Poorna,
>
> I did some testing with your proposed solution. I've followed up on
the
> Beehive dev alias as well. Unfortunately, I this solution may work for
> this customer case but it won't work for all controls. Some contextual
> services will be null. For example, a call to the ControlBeanContext
to
> get the PageFlowController service will be null in onAcquire() for the
> control. Similarly, the ControlContainerContext (a ServletBeanContext)
> will return null for any calls to getServletRequest() and
> getServletResponse().
>
> The automated tests in NetUI DRT do not cover the scenario of
> BEEHIVE-1094. Running them just ensures there are no regressions. You
> can see the failures by using the
> PageFlowControlBeanContext test manually. First uncomment the
"check()"
> method
> in the onDestroy() method of the controller...
> src/controls/pfbeancontext/PageFlowBeanContextController.java
> ...as described in BEEHIVE-1094.
>
> I don't think we would want to commit this solution to Beehive but
I've
> left that open to discussion on the dev alias. Maybe others in the
> community will have some more input or ideas. It's not an easy problem
> to solve.
>
> Since the proposed changes do seem to work for the customer's
scenario,
> maybe CCE makes a one-off patch for the customer? Do we want to meet
> Wednesday to discuss the best way to proceed?
>
> Kind regards,
> Carlin
>
>
> Poorna Ramasamy wrote:
>> Hi Carlin,
>>
>> It is been posted to beehive dev list. Regarding urgency, CR354242 is
>> the top of the PARCRR queue and a crit-sit, so it is very urgent.
>>
>> Yes, I tested the fix with controls usage at onDestroy method and it
>> resolves the issue. And, today I ran the beehive controls DRTs
>> successfully with the change.
>>
>> Please let me know if I need to try out something or anything that
> will
>> speed up to find the appropriate fix.
>>
>> regards,
>> ~Poorna
>>
>>
>>
>> -----Original Message-----
>> From: Carlin Rogers
>> Sent: Tuesday, December 11, 2007 2:14 AM
>> To: Poorna Ramasamy
>> Cc: Scott L'Hommedieu; Scott Roberts
>> Subject: Re: reg. CR354242 (BEEHIVE-1094)
>>
>> Hi Poorna,
>>
>> I'd really need to spend some time on this to make sure the proposed
>> code change is OK before submitting. Also, the best way to do this is
>> through the Beehive dev alias, [email protected]
>>
>> I'm not the expert on the controls so posting to the dev alias will
>> possibly get you a response from other devs in the Beehive community.
>>
>> At first glance, I think there will be issues because the
> RequestContext
>> pushed onto the RequestContext stack will have a null request and
>> response. This seems like it could be an issue for controls
> implemented
>> for Context Services that reuire the request. I'm also unsure if
there
>> are any implications to locking issues. I know some of the discussion
>> that helped uncover BEEHIVE-1094 was based on issues involving
>> destroying page flows, controls, and a deadlock. Have you walked
> through
>> the Controls side of this issue to make sure this fix is correct?
>>
>> What is the urgency on this fix? Unfortunately, I'm a little slammed
>> through the holidays, helping to get a release out so it would be
nice
>> to know the time frame and urgency. Thanks.
>>
>> Kind regards,
>> Carlin
>>
>>
>> Poorna Ramasamy wrote:
>>> Forgot to mention that the netui DRTs are running fine with the
>>> following change.
>>>
>>>
>>>
>>> regards,
>>>
>>> ~Poorna
>>>
>>>
>>>
>>>
>>>
>>>
>
------------------------------------------------------------------------
>>> *From:* Poorna Ramasamy
>>> *Sent:* Monday, December 10, 2007 1:04 PM
>>> *To:* Carlin Rogers
>>> *Subject:* reg. CR354242 (BEEHIVE-1094)
>>>
>>>
>>>
>>> Carlin,
>>>
>>>
>>>
>>> For BEEHIVE-1094, I am proposing the following change, please verify
>> and
>>> commit the change if it is okay.
>>>
>>>
>>>
>>> ====
>>>
>
//depot/dev/sandbox/beehive/wl92_ga/netui/src/pageflow/org/apache/beehiv
>> e/netui/pageflow/PageFlowManagedObject.java#1
>>> -
>>>
>
E:\P4\dev\sandbox\beehive\wl92_ga\netui\src\pageflow\org\apache\beehive\
>> netui\pageflow\PageFlowManagedObject.java
>>> ====
>>>
>>> 19a20,21
>>>
>>>> import
>> org.apache.beehive.controls.api.context.ControlContainerContext;
>>> 103c105,109
>>>
>>> < onDestroy( session );
>>>
>>> ---
>>>
>>> *> PageFlowControlContainer cc = new
>> PageFlowControlContainerImpl();*
>>>> ControlContainerContext ccContext =
>>> cc.getControlContainerContext(this);
>>>
>>>> cc.beginContextOnPageFlow(this, null, null,
>>> session.getServletContext());
>>>
>>>> onDestroy( session );
>>>> cc.endContextOnPageFlow(this);
>>>
>>>
>>>
>>>
>>> The highlighted first line - I am not sure on how to create
>>> PageFlowControlContainer using PageFlowControlContainerFactory when
>>> there is no request object. So, I have created the control container
>>> directly here.
>>>
>>>
>>>
>>>
>>>
>>> regards,
>>>
>>> ~Poorna
>>>
>>>
>>>
>>>
>>>
>>
>
>
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or legally
privileged, and is intended solely for the use of the individual or entity
named in this message. If you are not the intended recipient, and have received
this message in error, please immediately return this by email and then delete
it.
====
//depot/dev/sandbox/beehive/wl92_ga/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java#1
-
E:\P4\dev\sandbox\beehive\wl92_ga\netui\src\pageflow\org\apache\beehive\netui\pageflow\FlowController.java
====
606c606
< void destroy( HttpSession session )
---
> void destroy( HttpServletRequest request, HttpSession session )
609c609
< super.destroy( session );
---
> super.destroy( request, session );
====
//depot/dev/sandbox/beehive/wl92_ga/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowManagedObject.java#1
-
E:\P4\dev\sandbox\beehive\wl92_ga\netui\src\pageflow\org\apache\beehive\netui\pageflow\PageFlowManagedObject.java
====
19a20,22
> import org.apache.beehive.controls.api.context.ControlContainerContext;
>
> import
> org.apache.beehive.netui.pageflow.internal.DeferredSessionStorageHandler;
101c104
< void destroy( HttpSession session )
---
> void destroy( HttpServletRequest request, HttpSession session )
103c106,119
< onDestroy( session );
---
> if (request != null)
> {
> // initialize context if request is available
> PageFlowControlContainer cc =
> PageFlowControlContainerFactory.getControlContainer(request,
> session.getServletContext());
> ControlContainerContext ccContext =
> cc.getControlContainerContext(this);
> cc.beginContextOnPageFlow(this, request, null,
> session.getServletContext());
> onDestroy( session );
> cc.endContextOnPageFlow(this);
> }
> else
> {
> onDestroy( session );
> }
>
153c169,174
< destroy( session );
---
> HttpServletRequest req = null;
> if (event instanceof
> DeferredSessionStorageHandler.SessionBindingEvent)
> {
> req =
> ((DeferredSessionStorageHandler.SessionBindingEvent)event).getRequest();
> }
> destroy( req, session );
====
//depot/dev/sandbox/beehive/wl92_ga/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowStack.java#1
-
E:\P4\dev\sandbox\beehive\wl92_ga\netui\src\pageflow\org\apache\beehive\netui\pageflow\PageFlowStack.java
====
22a23
> import
> org.apache.beehive.netui.pageflow.internal.DeferredSessionStorageHandler;
222c223
< if ( ! popped.isLongLived() ) popped.destroy(
request.getSession( false ) );
---
> if ( ! popped.isLongLived() ) popped.destroy( request,
> request.getSession( false ) );
376c377,385
< if ( ! jpf.isLongLived() ) jpf.destroy( event.getSession() );
---
> if ( ! jpf.isLongLived() )
> {
> HttpServletRequest req = null;
> if (event instanceof
> DeferredSessionStorageHandler.SessionBindingEvent)
> {
> req =
> ((DeferredSessionStorageHandler.SessionBindingEvent)event).getRequest();
> }
> jpf.destroy( req, event.getSession() );
> }
====
//depot/dev/sandbox/beehive/wl92_ga/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DeferredSessionStorageHandler.java#2
-
E:\P4\dev\sandbox\beehive\wl92_ga\netui\src\pageflow\org\apache\beehive\netui\pageflow\internal\DeferredSessionStorageHandler.java
====
72c72
< private static final class SessionBindingEvent
---
> public static final class SessionBindingEvent
74a75,76
> HttpServletRequest request;
>
83a86,96
>
> public SessionBindingEvent( HttpServletRequest req, HttpSession
> httpSession, String attrName, Object attrVal )
> {
> this( httpSession, attrName, attrVal );
> request = req;
> }
>
> public HttpServletRequest getRequest()
> {
> return request;
> }
108c121
< HttpSessionBindingEvent event = new SessionBindingEvent( session,
attrName, currentValue );
---
> HttpSessionBindingEvent event = new SessionBindingEvent( request,
> session, attrName, currentValue );
139c152
< HttpSessionBindingEvent event = new SessionBindingEvent(
request.getSession(), attrName, currentValue );
---
> HttpSessionBindingEvent event = new SessionBindingEvent( request,
> request.getSession(), attrName, currentValue );