Monday, April 28, 2014

WLST script to set the JDBC Connection timeout properties in weblogic server

WLST script to set the JDBC Connection timeout properties in weblogic server

There are different timeout properties in JDBC connection, this tutorial explains the approach to set some of the important JDBC Connection timeout properties in weblogic server through WLST script.

Inactive Connection Timeout

The number of inactive seconds on a reserved connection before WebLogic Server reclaims the connection and releases it back into the connection pool.
You can use the Inactive Connection Timeout feature to reclaim leaked connections — connections that were not explicitly closed by the application.

Connection Reserve Timeout

The number of seconds after which a call to reserve a connection from the connection pool will timeout.
When set to 0, a call will never timeout.
When set to -1, a call will timeout immediately.

Statement Timeout

The time after which a statement currently being executed will time out.
A value of -1 disables this feature.
A value of 0 means that statements will not time out.


The property oracle.jdbc.ReadTimeout helps to set read timeout while reading from the socket. for jdbc versions < oracle.jdbc.ReadTimeout for jdbc versions >=

The property helps to set the login time out in Oracle.
WLST Script

The below WLST script will help us to set the JDBC connection timeout properties
def setJDBCTimeoutProperties():
   print '========================================='
   print 'Setting the timeout properties for DataSource....'
   print '========================================='  


Before executing the script, change the configurations as required.

Execute the script — <<Oracle_Home>>\oracle_common\common\bin\wlst.cmd

Restart the server after successful execution. Now the JDBC connection timeout properties are set to the datasource.

Under advanced section

No comments:

Post a Comment