Oracle Web Services On Demand Guide > Best Practices for Designing Client Application > Best Practices for Integration Performance >

Session Management and Pooling


It is recommended that you use stateless Web services as opposed to stateful Web services whenever possible, as described in Using Stateless Web Services. This topic however discusses the best practices for the situations when you use stateful Web services.

For stateful Web services requests, Web Services On Demand uses a session-based security mechanism for which each operation is synchronous.

It is recommended that a user:

  • Always closes sessions if the application process is not likely to be used multiple times within the session idle time-out period (10 minutes by default).
  • Always keeps sessions open and reuses them when the application process is likely to be used multiple times within the session idle time-out period. It is important to reuse sessions that are not in use, as frequent logins add overhead to your process and slow it down.

Client applications must not reuse sessions that are in use, in other words, they must not submit several simultaneous requests using the same session.

Client applications must not send multiple requests simultaneously using the same session ID, rather, the client must wait for a response before sending a new request using the same session ID.

The client time-out on a single Web service call must be set to at least 10 minutes, so that the client does not time out when a request is still pending. For information about Web services sessions, see About Establishing and Managing the Web Services Session.

Session Pooling

Session pooling is another option for increasing the performance of your application further. Session pooling involves maintaining a list of active sessions on the client application. The client application must ensure that each session is active and valid (it must have a valid session ID) before using it in a request. The client application can determine whether the session is active based on the success of the login operation and the time that has passed since the session was used. If all active sessions are in use for pending Web service requests, add a new session to the pool.

You can use session pooling to improve performance in both a single-threaded or multithreaded application. In a single-threaded application, session pooling can avoid the unnecessary overhead of relogging into Oracle CRM On Demand for each request. In a multithreaded application session, you can use session pooling to run multiple requests at the same time.

Oracle Web Services On Demand Guide, Version 21.0 (Oracle CRM On Demand Release 33) Copyright © 2016, Oracle and/or its affiliates. All rights reserved. Legal Notices.