IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Lost Session Attributes

    Posted Thu September 22, 2011 08:30 PM

    Hello guys:

    I’ve a portlet which is called with parameters, this porlet set some attributes for the session:

    javax.servlet.http.HttpServletRequest request = (javax.servlet.http.HttpServletRequest)com.webMethods.portal.framework.impl.PortalServlet.getCurrentRequest();

    HttpSession reqsession = request.getSession(true);
    reqsession.setAttribute(“someAttribute”, attribValue);

    Later in this same porlet I make a redirect to another porlet where I get this attribute normally:

    myValue = (String) reqsession.getAttribute(“someAttribute”);

    But when I choose another portlet from the left navigation panel the attribute seems to be lost because when I use getAttribute it return null.

    Best regards


    #webMethods-BPMS
    #MWS-CAF-Task-Engine
    #webMethods


  • 2.  RE: Lost Session Attributes

    Posted Thu September 22, 2011 10:17 PM

    I know you are trying to ensure that you’re accessing a shared session object, but i wonder if you might be accessing a session object that is isolated for each Portlet Application?

    One way to check would be to attach to your app with a debugger and see if the Session instance is the same in each portlet application.


    #webMethods
    #webMethods-BPMS
    #MWS-CAF-Task-Engine


  • 3.  RE: Lost Session Attributes

    Posted Fri September 23, 2011 03:08 PM

    mimel:

    Seems to be that situation, the session is isolated from the other portlet application, but it should not, Am I right?, I need to work with a shared session, I wonder if the approach I’m using it’s correct…

    regards


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 4.  RE: Lost Session Attributes

    Posted Fri September 23, 2011 05:00 PM

    HttpSession reqsession = PortalServlet.getCurrentRequest().getSession(true);

    reqsession.getId();

    Return the same Id from both portlets.


    #webMethods-BPMS
    #webMethods
    #MWS-CAF-Task-Engine


  • 5.  RE: Lost Session Attributes

    Posted Fri September 23, 2011 07:33 PM

    I resolved using:

    context = ContextFactory.acquireContext(false);

    context.setAttribute(“userID”, vuserID, IContext.SCOPE_SESSION);
    context.getAttribute(“userID”, IContext.SCOPE_SESSION);

    regards.


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 6.  RE: Lost Session Attributes

    Posted Thu September 29, 2011 01:32 AM

    If MWS is in clustered mode, how this session value works?


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 7.  RE: Lost Session Attributes

    Posted Tue October 18, 2011 06:37 PM

    By now we’re not working in clustered mode.

    Regards.


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS


  • 8.  RE: Lost Session Attributes

    Posted Tue October 18, 2011 07:08 PM

    Sessions (and their attributes) are not replicated across a cluster.
    Regards,
    –mark


    #webMethods-BPMS
    #webMethods
    #MWS-CAF-Task-Engine