web server - Borland Technical Publications

web server - Borland Technical Publications web server - Borland Technical Publications

techpubs.borland.com
from techpubs.borland.com More from this publisher
12.11.2014 Views

Getting debug output Table 22.1 maxPreparedStatemen tsPerQuery Connection Pool Properties for a JDBC Datasource (continued) Name Allowed Values Description Default Value Integer Under certain conditions such as high concurrency or when CMP 2.0 entity beans are processed, more than one PreparedStatement can be processed concurrently for the same SQL query on the same pooled connection. For example, a SQL query SELECT name FROM table1 WHERE id=? can return distinct result sets when different values are used for ?. Although the PreparedStatement cache has a single entry for each SQL query, two or more PreparedStatements can exist in the cache for the query. This property specifies the maximum number of cached PreparedStatements for a single query. If the limit is exceeded for a particular query, subsequent javax.sql.Connection.prepareStatem ent() calls result in non-cached instances of PreparedStatement objects created and returned to the caller. Like maxPreparedStatementCacheSize, this property is only effective when the reuseStatements property of the datasource is set to true (default). 20 Getting debug output A number of system properties can be set to log activity at datasource, connection pool, connection and statement levels during application processing. It is not necessary to configure these properties during normal application runtime execution but should a situation arise where details of JDBC flow of control is needed these options are useful. Runtime output generated with these properties set can be provided to Borland Technical Support to help resolve issues involving JDBC datasource and connections. Setting these properties for a partition results in log message generation during JDBC activity. Note that additional log4j configuration is required to ensure that the messages are actually written to the partition log. Locate the partition's log4j configuration file, called logConfiguration.xml, and add the following element: ... ... ... System Property Name Type Description Default DataSourceDebug Boolean Reports activity at datasource level for all datasources ConnectionPoolDebug Boolean Reports activity at connection pool level for all datasources False False Chapter 22: Using JDBC 203

Descriptions of Borland Enterprise Server's Pooled Connection States System Property Name Type Description Default ConnetionPoolStateD ebug Boolean Reports transitions of connections in connection pool JDBCProxyDebug Boolean Reports activity at connection level for all connections PreparedStatementCa cheDebug Boolean Reports activity at prepared statement level for all statements False False False Descriptions of Borland Enterprise Server's Pooled Connection States When the EJB container's statistic gathering option is enabled, the Partition event log contains useful statistics about the JDBC connections pool. The log lists the number of connections in the various lifecycle states of a pooled JDBC2 connection. Following is a description of each state: ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Free: a cached/pooled connection that is available for use by an application TxBusy: a cached connection that is in use in a transaction NoTxBusy: a cached connection that is in use by an application with no transaction context Committed: a connection that was associated with a transaction received a commit() call from the transaction service RolledBack: a connection that was associated with a transaction received a rollback() call from the transaction service Prepared: a connection that was associated with a transaction received a prepare() call from the transaction service Forgot: a connection that was associated with a transaction received a forget() call from the transaction service TxBusyXaStart: a pooled connection that is associated with a transaction branch. TxBusyXaEnd: a pooled connection that has finished its association with a transaction branch BusyTimedOut: a cached connection that was removed from the pool after it stayed with the transaction longer than the busyTimeout pool property IdleTimedOut: a connection that was removed from the pool due to being idle for longer than the pool's idleTimeout property JdbcHalfCompleted: a transitionary state where the connection is participating in a background housekeeping activity related to pool management (being refreshed, for example) and therefore, unavailable until the activity completes Closed: the underlying JDBC connection was closed Discarded: A cached connection got discarded (due to timeout errors, for example) JdbcFinalized: an unreferenced connection was garbage collected Support for older JDBC 1.x drivers JDBC 1x drivers do not provide a datasource object. Under the J2EE specification, however, database connections are always fetched using the javax.sql.DataSource interface. To allow users to still use JDBC 1x drivers, Borland Enterprise Server provides an implementation of a JDBC 1x datasource to allow writing portable J2EE code. This implementation is a facade provided on top of the DriverManager connection mechanism of the JDBC 1x specification. 204 BES Developer’s Guide

Descriptions of <strong>Borland</strong> Enterprise Server's Pooled Connection States<br />

System Property<br />

Name Type Description Default<br />

ConnetionPoolStateD<br />

ebug<br />

Boolean<br />

Reports transitions of connections in<br />

connection pool<br />

JDBCProxyDebug Boolean Reports activity at connection level for all<br />

connections<br />

PreparedStatementCa<br />

cheDebug<br />

Boolean<br />

Reports activity at prepared statement level<br />

for all statements<br />

False<br />

False<br />

False<br />

Descriptions of <strong>Borland</strong> Enterprise Server's Pooled Connection States<br />

When the EJB container's statistic gathering option is enabled, the Partition event log<br />

contains useful statistics about the JDBC connections pool. The log lists the number of<br />

connections in the various lifecycle states of a pooled JDBC2 connection. Following is<br />

a description of each state:<br />

■<br />

■<br />

■<br />

■<br />

■<br />

■<br />

■<br />

■<br />

■<br />

■<br />

■<br />

■<br />

■<br />

■<br />

■<br />

Free: a cached/pooled connection that is available for use by an application<br />

TxBusy: a cached connection that is in use in a transaction<br />

NoTxBusy: a cached connection that is in use by an application with no transaction<br />

context<br />

Committed: a connection that was associated with a transaction received a<br />

commit() call from the transaction service<br />

RolledBack: a connection that was associated with a transaction received a<br />

rollback() call from the transaction service<br />

Prepared: a connection that was associated with a transaction received a prepare()<br />

call from the transaction service<br />

Forgot: a connection that was associated with a transaction received a forget() call<br />

from the transaction service<br />

TxBusyXaStart: a pooled connection that is associated with a transaction branch.<br />

TxBusyXaEnd: a pooled connection that has finished its association with a<br />

transaction branch<br />

BusyTimedOut: a cached connection that was removed from the pool after it<br />

stayed with the transaction longer than the busyTimeout pool property<br />

IdleTimedOut: a connection that was removed from the pool due to being idle for<br />

longer than the pool's idleTimeout property<br />

JdbcHalfCompleted: a transitionary state where the connection is participating in a<br />

background housekeeping activity related to pool management (being refreshed, for<br />

example) and therefore, unavailable until the activity completes<br />

Closed: the underlying JDBC connection was closed<br />

Discarded: A cached connection got discarded (due to timeout errors, for example)<br />

JdbcFinalized: an unreferenced connection was garbage collected<br />

Support for older JDBC 1.x drivers<br />

JDBC 1x drivers do not provide a datasource object. Under the J2EE specification,<br />

however, database connections are always fetched using the javax.sql.DataSource<br />

interface. To allow users to still use JDBC 1x drivers, <strong>Borland</strong> Enterprise Server<br />

provides an implementation of a JDBC 1x datasource to allow writing portable J2EE<br />

code. This implementation is a facade provided on top of the DriverManager<br />

connection mechanism of the JDBC 1x specification.<br />

204 BES Developer’s Guide

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!