DevPortal

What are the Resource Properties available?


Table of Contents


This section discusses the properties available to tune JDBC resources. These values can be provided at the time of creating the resource and can be modified at runtime using the Console.

Max Pool Size

This represents the maximum number of connection objects that can be present in a pool. Maintaining a pool of datasource objects avoids the overhead of creating an object every time a request for a connection object is made. The default value for the connection pool size is 20.

This value should be set to the maximum number of connections that can be used at any given time. Setting a value lower than this would result in connections waiting for release of other connections that are in use at peak time. The resource service ensures that the maximum pool size is not exceeded. If the limit is reached, and a new connection request is made when other connections are busy, the connection pool waits till a connection is free.

Min Pool Size

This value represents the minimum number of connections to be retained in the connection pool at any given time. The default value is 5. For optimum performance, set this value to the average number of connections used at any given time.

Initial Pool Size

This value represents the number of connections the connection pool will have when the datasource is created for the first time. The default value is 1. The primary purpose of this parameter is to allow faster response times for connection requests when the application uses the datasource pool for the first time.

Idle Timeout

The time interval in seconds after which a connection in the pool is closed if no request arrives. The default value is 300 seconds.

Tuning this value depends on a number of parameters. For example, if connection requests arrive at uneven intervals, this can result in pre-mature close of connections and would require connections to be created on subsequent requests, thus consuming processing time. On the other hand, if this value is set to too high a value, connections would be idle in the pool, consuming memory.

Ideally this value should be set to the average intervals at which connections are requested.

Connection Request Timeout

The time interval in seconds for which an application can wait after making a connection request. After this interval, an exception is thrown to the application. The default value 10 seconds.

This parameter should be configured carefully — setting too low a value might result in application connection requests getting timed out prematurely, while setting too high a value might make a connection request wait for longer than is necessary.

Cached Prepared Statements

This option represents the number of prepared statements that should be cached. Each connection has it's own prepared statement cache. Specify here the number of prepared statements to be cached. The value for cache is application dependent. For optimal performance, this value should equal the number of prepared statements in the application. The default value is 20.

In Pramati’s implementation, the number of prepared statements in use might exceed the maximum prepared statement cache size, if the number of requests from the application exceeds it. However, on closing the connection the size is reduced to the maximum size set in the resource-config.xml.

© Pramati Technologies 2007 Runs on Pramati Server | Feedback | Legal