[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.]

Max Poon <[email protected]>
Newsgroups gmane.text.xml.soap.devel
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.