0

I have a Serializable ActionForm that holds an instance of another Serializable object. This object have a synchronized method which I can't change right now.

I want to know if my form object is the same across different requests, because the application is facing some slowness exactly before that synchornized method.

This is my ActionMapping:

<action attribute="myActionForm"
            name="myActionForm"
            path="/myAction"
            type="myAction"
            parameter="task"
            scope="session"
            validate="false">
         <forward name="tasks" path=".tasks.new" />             
    </action>

And this is my Action:

public ActionForward taskName(ActionMapping mapping, ActionForm frm, HttpServletRequest request, HttpServletResponse response) throws IntegrationException {
    MyForm form = (MyForm) frm;

    form.getObjectX().executeSynchronizedMethodX();

    return mapping.findForward("tasks");
}

This form is sent back from the view to the same ActionForward.

dinhokz
  • 895
  • 15
  • 36

1 Answers1

1

It's the same bean in the same session; that's what session-scoped means

Across requests it depends on if the requests are made in the same session.

Dave Newton
  • 158,873
  • 26
  • 254
  • 302
  • Thank you Dave, I wasn't able to test it before. But we noticed that the same user was having the problem because he was making many requests simultaneously. So he was "competing with himself" to access the method. – dinhokz Mar 11 '16 at 15:11
  • @dinhokz Correct; if the same user is on the same browser and has multiple windows/tabs open, that user has the same session (normally). – Dave Newton Mar 11 '16 at 15:14
  • I know that. The question was if the form object is exactly the same instance across different requests. – dinhokz Mar 11 '16 at 17:50
  • @dinhokz I was confirming what you said? – Dave Newton Mar 11 '16 at 17:55