Weblogic different timeouts

Weblogic have a different timeout setting available based on what exactly is being used and type of the application.
WebLogic provides a default transaction timeout of 30 seconds, therefore if a transaction is still in an “active” state after this time (counting from begin()), the transaction is automatically rolled back.

How to Set Timeout for WebLogic Web Service Client (JAX-WS and JAX-RPC) ???

The below options are for timeout only for JAX-WS Web Service clients generated from clientgen:

import javax.xml.ws.BindingProvider;
import javax.xml.ws.handler.MessageContext;
import com.sun.xml.ws.developer.JAXWSProperties;
import com.sun.xml.ws.client.BindingProviderProperties;
/*
The following classes are inside

import com.sun.xml.ws.developer.JAXWSProperties;
import com.sun.xml.ws.client.BindingProviderProperties;

%WLSINSTALLATION%\modules\glassfish.jaxws.rt_1.1.0.0_2-1-4.jar
*/
Map requestContext = ((BindingProvider)port).getRequestContext();
requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
“http://<hostname.domain>/HelloWorldImpl/HelloWorldService”);
requestContext.put(JAXWSProperties.CONNECT_TIMEOUT, 300);
requestContext.put(BindingProviderProperties.REQUEST_TIMEOUT, 300);

The below options are for timeout only for JAX-RPC Web Service clients generated from clientgen:

import javax.xml.rpc.Stub;

((Stub)port)._setProperty(weblogic.wsee.transport.connection.timeout,2);
((Stub)port)._setProperty(weblogic.wsee.transport.read.timeout,2);

The below options are for timeout not only for Web Service clients but for all clients:

-Dweblogic.https.client.defaultConnectTimeout=xxxx milisecs
-Dweblogic.http.client.defaultConnectTimeout=xxxx milisecs

OR
-Dweblogic.webservice.UseWebLogicURLStreamHandler=false
-DUseSunHttpHandler=true
-Dsun.net.client.defaultConnectTimeout=xxxx milisecs
-Dsun.net.client.defaultReadTimeout=xxxx milisecs

What Happens to the Active Oracle Database Session in the Event of Read Timeout Breached on Weblogic Datasource ??

What happens to the active Oracle Database Session initiated from WebLogic Data Source in the event of configured Read timeout is breached on the WebLogic Data Source.

Scenario:
1. WebLogic Data Source configured with Read Timeout of 10secs (oracle.jdbc.ReadTimeout)
2. Oracle Database takes longer than 10secs to execute the SQL Procedure invoked by the WebLogic Data Source.
3. On the 11th second, after waiting 10secs for response from the Database, the WebLogic Data Source sends a Read Timed out message to the client.

When this happens, what happens to the Active Database Session which was executing the call?

The query will likely continue for a short while until the Database notices the client is gone. There is a parameter set on the database SQLNET.EXPIRE_TIME to specify a time interval, in minutes, to send a probe to verify that client/server connections are active. There is no option to automatically trigger a kill to the Active Database Session in the event Weblogic Data Source Read Timeout is breached.

How to Configure Session Timeout in Weblogic Server 

There are three ways to set a web application session timeout parameter on WebLogic Server 

The File web.xml

Edit the session-timeout of the session-config in the file web.xml. Please note in web.xml, the session timeout is set in minutes.<session-config>
 <session-timeout>60</session-timeout>
</session-config>

Note:The timeout value set in web.xml takes precedence over weblogic.xml. If you don’t set any values in web.xml, weblogic.xml takes over. A good approach to handle session timeout is setting this just on web.xml itself since web.xml takes precedence over application server’s deployment descriptors.

The File weblogic.xml

Edit the timeout-secs parameter in the file weblogic.xml. In weblogic.xml, the session timeout is set in seconds.<session-descriptor>
  <timeout-secs>3600</timeout-secs>
</session-descriptor>

Application Code

Setting this parameter by java code on your servlet or JSP file. This is a method in the public interface HttpSession.Public void setMaxInactiveInterval(int interval)

Specifies the time, in seconds, between client requests before the servlet container will invalidate this session. A negative time indicates the session should never timeout.Public int getMaxInactiveInterval()

Returns the maximum time interval, in seconds, that the servlet container will keep this session open between client accesses. After this interval, the servlet container will invalidate the session. The maximum time interval can be set with the setMaxInactiveInterval method. A negative time indicates the session should never timeout.

How To Change Transaction Timeout For WebLogic Application Server ??

Total Transaction Timeout

OIM treats each API call as one Transaction. For example saving a process form is treated as one transaction including all the provisioning that happens due to the save of the form. Each Application Server expects all transactions to finish in particular number of seconds. However depending on what is provisioned it may take more time. To handle situations like this, increase the timeout to a sufficiently large number. 

Note: Following exception is seen when the Transaction Timeout is not sufficient: weblogic.transaction.internal.TimedOutException: Transaction timed out after 300 seconds


How To Change Transaction Timeout for WebLogic Application Server:

Option 1:

1. Edit the weblogic.profile file in the <xlhome>/Profiles directory. (For example /home/oracle/oim/xellerate/Profiles/weblogic.profile)
2. Change the weblogic.transaction.timeout value in the file to a large number. For example:
weblogic.transaction.timeout=1200


Option 2:

After logging in Weblogic console, on the home page of the Server Console you should see
3 sections:

* Information and Resources
* Domain Configurations
* Services Configurations

Under Services Configurations there is subsection Other Services. Click the JTA Configuration link under Other Services. The transaction timeout should be the top setting on the page displayed, labelled Timeout Seconds.

Note:  If one choose to use the Option 2, then they also update the the weblogic.properties with the same value.

Based on the application design and requirement one should plan for the timeout value changes if the default values are not sufficient . Hope this gives overall weblogic timeout on one page .

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *