Sun GlassFish Enterprise Server 2.1 Administration Guide

Editing JDBC Connection Pool Advanced Attributes

To help diagnose connection leaks and improve ease-of–use, Application Server 9.1 provides several new attributes to configure a connection pool at the time of its creation.

  1. Open the Advanced tab and specify the following attributes.




    Name of the JDBC connection pool whose properties you want to edit. You cannot change the pool name, however. 

    Statement Timeout 

    Time in seconds after which abnormally long running queries will be terminated. Application Server will set "QueryTimeout" on the statements created. The default value of -1 implies that the attribute is not enabled. 

    Wrap JDBC Objects 

    When set to true, application will get wrapped jdbc objects for Statement, PreparedStatement, CallableStatement, ResultSet, DatabaseMetaData. The default value is false. 

  2. Specify the Connection Settings as explained in the following table.



    Validate Atmost Once 

    Amount of time, in seconds, after which a connection is validated at most once. This will help reduce the number of validation requests by a connection. The default value 0 implies that connection validation is not enabled. 

    Leak Timeout 

    Amount of time, in seconds, to trace connection leaks in a connection pool. The default value 0 means that connection leak tracing is disabled. If connection leak tracing is enabled, you can get statistics on the number of connection leaks in the Monitoring Resources tab. To view this tab, go to Application Server > Monitoring > Resources.  

    Leak Reclaim 

    If this option is enabled, leaked connections will be restored to the pool after leak connection tracing is complete. 

    Creation Retry Attempts 

    Number of attempts that will be made if there is a failure in creating a new connection. The default value of 0 implies that no attempts will be made to create the connection again. 

    Retry Interval 

    Specify the interval, in seconds, between two attempts to create a connection. The default value is 10 seconds. This attribute is used only if the value of Creation Retry Attempts is greater than 0. 

    Lazy Connection Enlistment 

    Enable this option to enlist a resource to the transaction only when it is actually used in a method. 

    Lazy Association 

    Connections are lazily associated when an operation is performed on them. Also, they are disassociated when the transaction is completed and a component method ends, which helps reuse of the physical connections. Default value is false. 

    Associate with Thread 

    Enable this option to associate a connection with the thread such that when the same thread is in need of a connection, it can reuse the connection already associated with that thread, thereby not incurring the overhead of getting a connection from the pool. Default value is false. 

    Match Connections  

    Use this option to switch on/off connection matching for the pool. It can be set to false if the administrator knows that the connections in the pool will always be homogeneous and hence a connection picked from the pool need not be matched by the resource adapter. Default value is false. 

    Max Connection Usage 

    Specify the number of times a connection should be reused by the pool. Once a connection is reused for the specified number of times, it will be closed. This is useful, for instance, to avoid statement-leaks. The default value of 0 implies that no connections will be reused.