All Downloads are FREE. Search and download functionalities are using the official Maven repository.

en.help.ref-jdbcconnpooladvanceattrtab.html Maven / Gradle / Ivy

The newest version!

Edit Connection Pool Advanced Attributes

Use the Edit Connection Pool Advanced Attributes page to specify attributes that help diagnose connection leaks and improve ease-of–use.

The Edit Connection Pool Advanced Attributes page contains the following options.

Load Defaults

Button to restore settings that have default values to their default values. Settings that do not have default values are not changed.

Pool Name

The name of the connection pool. The name is a read-only field. You can only specify the connection pool name when you create a new JDBC connection pool.

Statement Timeout

The length of time, in seconds, after which abnormally long running queries will be terminated. GlassFish Server will set QueryTimeout on the statements created. A value of –1 means that the option is disabled. The default value is –1.

Statement Cache Size

The number of statements to be cached using the LRU (Least Recently Used) caching mechanism. A value of 0 disables statement caching. The default value is 0.

Init SQL

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.

SQL Trace Listeners

A comma-separated list of listener implementation class names, which specifies 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.

Wrap JDBC Objects

If this option is enabled, applications will get wrapped JDBC objects for Statement, PreparedStatement, CallableStatement, ResultSet, DatabaseMetaData. This option is enabled by default.

Pooling

Enables connection pooling for the pool. This option is enabled by default.

Validate At Most Once

Specifies the time interval in seconds between successive requests to validate a connection 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.

Leak Timeout

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. A value of 0 means that connection leak tracing is disabled. The default value is 0.

Use this field along with Leak Reclaim to avoid potential connection leaks from the application.

Leak Reclaim

If this option is enabled, leaked connections are restored to the pool after leak connection tracing is complete. This option is disabled by default.

Creation Retry Attempts

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

Retry Interval

The interval of time, 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.

Lazy Association

If this option is enabled, a physical connection is associated 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. This option is disabled by default.

Lazy Connection Enlistment

If this option is enabled, a resource is enlisted to the transaction only when it is actually used in a method. This option is disabled by default.

Associate with Thread

If this option is enabled, an association is made between a connection and a 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. This option is disabled by default.

Match Connections

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 safely be disabled if the administrator knows that the connections in the pool will always be homogeneous and hence a connection picked from the pool does not need to be matched by the resource adapter. This option is disabled by default.

Max Connection Usage

The number of times that 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. A value of 0 means that this attribute is disabled. The default value is 0.

Connection Validation

If this option is enabled, connection validation is required, allowing the server to reconnect in case of failure.

Validation Method

The GlassFish Server can validate database connections in the following ways.

auto-commit and metadata

The GlassFish Server validates a connection by calling the con.getAutoCommit or con.getMetaData method.


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.

Table Name

Name of the database table for validation. This field is applicable only if the Validation Method was set to table.

Validation Classname

The custom validation implementation class name. This field is applicable only if the Validation Method was set to custom-validation. The class name provided must be accessible to the GlassFish Server. The specified class must implement the org.glassfish.api.jdbc.ConnectionValidation interface.

On Any Failure

If this option is enabled, the GlassFish Server closes all connections in the pool and reestablishes them when any connection fails. If the option is disabled, individual connections are reestablished only when they are used. This option is disabled by default.

Allow Non Component Callers

If this option is enabled, the pool can 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.

Related Tasks
Related asadmin Commands
Copyright © 2005, 2011, Oracle and/or its affiliates. All rights reserved. Legal Notices




© 2015 - 2024 Weber Informatics LLC | Privacy Policy