You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@ws.apache.org by Max Poon <ma...@graduate.hku.hk> on 2004/01/06 11:37:27 UTC

[Fwd: Re: Request Scope does not invalidate the session at the end of therequest, long-lived sessions hang until timeout causing out-of-sessions error.]

Hi all

I am also deploying applications on top (routed by 
MessageRouterServlet).  It seems that, during our stress test, the 
MessageRouterServlet is creating a lot of Session objects and exceeding 
the servlet container's limit.

Since my 'application' can just run within the request and does not need 
to use Session, is it advisable to just use a 'customized' 
MessageRouterServlet (and called it some other name) for my application 
with the Session creation statements commented out in the doPost() 
method so that no more Session objects created (i.e. codes as follow), 
any side effects for this or is there better means?

     ..............
     ..............

  public void doPost (HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
  {
    ServletConfig config = getServletConfig();
    ServletContext context = config.getServletContext ();
    // HttpSession session = req.getSession ();
    ServiceManager serviceManager =
      ServerHTTPUtils.getServiceManagerFromContext (context, 
configFilename);
    int status;
    DeploymentDescriptor dd = null;
    TransportMessage sres;

    SOAPContext reqCtx = new SOAPContext() ;
    SOAPContext resCtx = new SOAPContext() ;

    reqCtx.setClassLoader( ServerHTTPUtils.
                             getServletClassLoaderFromContext(context) );

    try {
      try {
        reqCtx.setProperty( Constants.BAG_HTTPSERVLET, this );
    //  reqCtx.setProperty( Constants.BAG_HTTPSESSION, session );
        reqCtx.setProperty( Constants.BAG_HTTPSERVLETREQUEST, req );
        reqCtx.setProperty( Constants.BAG_HTTPSERVLETRESPONSE, res );
     ..............
     ..............


Thanks
Max