en.help.task-jdbcconnectionpooladvance.html Maven / Gradle / Ivy
Show all versions of console-jdbc-plugin-help
To Edit JDBC Connection Pool Advanced Attributes
- In the navigation tree, expand the Resources node.
- Under the Resources node, select the JDBC node.
- Under the JDBC node, select the Connection Pools node.
The Connection Pools page opens.
- On the Connection Pools page, click the name of the pool that you
are editing.
The Edit Connection Pool page opens.
- On the Edit Connection Pool page, click the Advanced tab.
The Edit Connection Pool Advanced Attributes page opens.
- In the Statement Timeout field, type the length of time, in seconds, after
which abnormally long running queries will be terminated.
GlassFish Server will set QueryTimeout on the statements created. Set the value to -1
to disable this option. The default value is -1.
- In the Statement Cache Size field, type the number of statements to be
cached using the LRU (Least Recently Used) caching mechanism.
To disable statement caching, specify a value of 0. The default value is
0.
- In the Init SQL field, type an SQL string to be executed
whenever a connection is created (not reused) in the pool.
Execution of this string initializes the state of the connection.
- In the SQL Trace Listeners field, type a comma-separated list of listener implementation
class names to specify that SQL statements executed by applications will be traced.
The listener classes must implement the org.glassfish.api.jdbc.SQLTraceListener interface. Use of listeners enables easy filtering
of log messages for the SQL statements and helps administrators analyze the statements.
- Select the Wrap JDBC Objects Enabled checkbox for applications to get wrapped JDBC
objects for Statement, PreparedStatement, CallableStatement, ResultSet, DatabaseMetaData.
This option is enabled by default.
- Select the Pooling checkbox to enable connection pooling for the pool.
This option is enabled by default.
- In the Validate At Most Once field, type the amount of time,
in seconds, after which a connection is validated at most once.
Setting this attribute to an appropriate value minimizes the number of validation requests by
a connection. Default value is 0, which means that the attribute is not
enabled.
- In the Leak Timeout field, type the amount of time, in seconds, to
trace connection leaks in a connection pool.
Use this field to detect potential connection leaks by the application. A connection
that is not returned back to the pool by the application within the
specified period is assumed to be potentially leaking, and a stack trace of
the caller is logged. Set the value to 0 to disable connection leak
tracing. The default value is 0.
Use this field along with Leak Reclaim to avoid potential connection leaks from
the application.
- Select the Leak Reclaim checkbox to restore leaked connections to the pool after
leak connection tracing is complete.
This option is disabled by default.
- In the Creation Retry Attempts field, type the number of attempts that will
be made if there is a failure in creating a new connection.
Set the value to 0 to make no attempts to create the
connection again. The default value is 0.
- In the Retry Interval field, type the interval, in seconds, between two attempts
to create a connection.
The default value is 10. This attribute is used only if the value
of Creation Retry Attempts is greater than 0.
- Select the Lazy Association Enabled checkbox to associate a physical connection with a
logical collection only when the connection is used.
Connections are disassociated when the transaction is completed and a component method ends,
which helps reuse of the physical connections. If this option is disabled, a
physical connection is associated with a logical connection even before it is used.
This option is disabled by default.
- Select the Lazy Connection Enlistment Enabled checkbox to enlist a resource to the
transaction only when it is actually used in a method.
This option is disabled by default.
- Select the Associate with Thread Enabled checkbox to create associations between connections and
threads.
When the same thread is in need of another connection, it can reuse
the connection already associated with that thread, thereby not incurring the overhead of
getting another connection from the pool. This option is disabled by default.
- Select the Match Connections Enabled checkbox to enable connection matching for the pool.
If this option is enabled, a connection that is selected from the pool
should be matched with connections that have certain credentials. This option must be
enabled if the connection pool is used by applications that have multiple user
credentials. This option can be disabled if the administrator knows that the connections
in the pool will always be homogeneous and therefore a connection picked from
the pool does not need to be matched by the resource adapter. This
option is disabled by default.
- In the Max Connection Usage field, type 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. By limiting the number of times a connection can be reused,
you can avoid statement leaks if an application does not close statements. Set
the value to 0 disable this attribute. The default value is 0.
- Select the Connection Validation Required checkbox to enable connection validation.
Connection validation allows the server to reconnect in case of failure.
- From the Validation Method drop-down list, select a validation method.
The GlassFish Server can validate database connections in the following ways.
- auto-commit and metadata
The GlassFish Servervalidates a connection by calling the con.getAutoCommit and con.getMetaData methods.
Note - Many JDBC drivers cache the results of these calls. As a result, using these calls might not always provide reliable validations. Check with the driver vendor to determine whether these calls are cached or not.
- custom-validation
The GlassFish Server uses a user-defined validation mechanism specified by the custom implementation class in the Validation Classname field.
- table
The application queries the database table that is specified. The table must exist and be accessible, but it does not require any rows. Do not use an existing table that has a large number of rows, or a table that is already frequently accessed.
- If you selected table from the Validation Method drop-down list, select the name
of the database table from the Table Name drop-down list.
- If you selected custom-validation from the Validation Method drop-down list, type the custom
validation implementation class name.
The class name provided must be accessible to the GlassFish Server. The specified
class must implement the org.glassfish.api.jdbc.ConnectionValidation interface.
- Select the On Any Failure Close All Connections checkbox to have the server
close and reestablish all connections in the pool in the event of a
single connection failure.
If this option is disabled, individual connections are reestablished only when they are
used. This option is disabled by default.
- Select the Allow Non Component Callers Enabled checkbox to allow the pool to
be used by non-component callers such as servlet filters and third-party persistence managers.
Connections obtained by non-component callers are not automatically closed at the end of
a transaction by the container. They must be explicitly closed by the caller.
This option is disabled by default.
- (Optional) Click the Flush button on the General tab to flush all connections from
the pool.
Clicking the Flush button destroys any existing connections, recreates connections established for the pool,
and restores the pool to its initial and minimum pool size.
- Click Save.
Tip - To return to the default settings, click the Load Defaults button, then click
Save.
See Also
-
-
-
-
-
-
-
-
-
-
-
Copyright © 2005, 2011, Oracle and/or its affiliates. All rights reserved. Legal Notices