cancel
Showing results for 
Search instead for 
Did you mean: 

How to disable u201Csticky sessionu201D for the particular web application?

Former Member
0 Kudos

Hi All,

Is there a possibility to disable so called u201Csticky sessionu201D for the particular web application? We have deployed a WAR file with the Axis 1.4 based web service into SAP NW 7.1. The web service works fine but when the client makes SOAP request the server creates a so-called u201Cstickyu201D HTTP session with the default (30 minutes) timeout. Such u201Csessionsu201D are created on each SOAP request from the same client. The maximum number for Java Web Sessions (SAP Management Console) is 1000. After a while the clients start getting the u201C503 Service not availableu201D errors:

503 Service not available.

-


Error: -6

Version: 7010

Component: ICM Java

Date/Time: Tue Mar 03 14:30:12 2009

Module: http_j2ee2.c

Line: 1166

Server: XXXXXXXXXXX

Error Tag:

Detail: server overload: no more sessions available

The only way to improve the situation we found so far was to set session timeout to 1 minute. That u201Csticky sessionu201D will still be created, though.

This is a testing environment and we do not use any hardware/software loadbalancer.

Any help/advice is appreciated. (Please let me know if you need more information.)

Thanks,

Dmitry Vasilenko

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

The practical workaround we finally come up with for this problem was to create a servlet filter and map it to the AxisServlet. The servlet filter will invalidate the HTTP session and effectively destroy the sticky session created by the server on each SOAP request.

Here is the fragment from the web.xml

<filter>

<filter-name>StickySessionFilter</filter-name>

<filter-class>com.xxxxx.xxxxx.xxxx.services.StickySessionFilter</filter-class>

</filter>

<filter-mapping>

<filter-name> StickySessionFilter </filter-name>

<servlet-name>AxisServlet</servlet-name>

</filter-mapping>

<servlet>

<servlet-name>AxisServlet</servlet-name>

<servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>

</servlet>

The doFilter() method looks like this:

public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {

try {

chain.doFilter(request, response);

} finally {

javax.servlet.http.HttpServletRequest httpRequest = (javax.servlet.http.HttpServletRequest)request;

javax.servlet.http.HttpSession session = httpRequest.getSession();

session.invalidate();

}

}

}

Thanks,

Dmitry Vasilenko

ravindra_bollapalli2
Active Contributor
0 Kudos

hi,

this may be help full to u,

Sticky session refers to the feature of many commercial load balancing solutions for web-farms to route the requests for a particular session to the same physical machine that serviced the first request for that session. This is mainly used to ensure that a in-proc session is not lost as a result of requests for a session being routed to different servers. Since requests for a user are always routed to the same machine that first served the request for that session, sticky sessions can cause uneven load distribution across servers.

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b52456bd-0a01-0010-6d9b-f153bf15...

let me know am i correct or not

bvr