web server - Borland Technical Publications
web server - Borland Technical Publications web server - Borland Technical Publications
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
- Page 163 and 164: Setting Properties Security Propert
- Page 165 and 166: Aggregate Functions in EJB-QL Selec
- Page 167 and 168: Support for ORDER BY Support for OR
- Page 169 and 170: Overriding SQL generated from EJB-Q
- Page 171 and 172: Container-managed data access suppo
- Page 173 and 174: 162 BES Developer’s Guide
- Page 175 and 176: Generating primary keys from a cust
- Page 177 and 178: Implementing primary key generation
- Page 179 and 180: Transaction manager services Consis
- Page 181 and 182: Transaction manager services When t
- Page 183 and 184: Transaction manager services Follow
- Page 185 and 186: Declarative transaction management
- Page 187 and 188: Declarative transaction management
- Page 189 and 190: JDBC API Modifications JDBC API Mod
- Page 191 and 192: Handling of EJB exceptions Applicat
- Page 193 and 194: 182 BES Developer’s Guide
- Page 195 and 196: Client View of an MDB Client View o
- Page 197 and 198: Clustering of MDBs This is yet anot
- Page 199 and 200: Error Recovery Redelivered messages
- Page 201 and 202: 190 BES Developer’s Guide
- Page 203 and 204: JNDI Definitions Module Important s
- Page 205 and 206: Disabling and Enabling a Deployed D
- Page 207 and 208: Configuring JDBC Datasources In the
- Page 209 and 210: Configuring JDBC Datasources To add
- Page 211 and 212: Defining the Connection Pool Proper
- Page 213: Defining the Connection Pool Proper
- Page 217 and 218: Advanced Topics for Defining JDBC D
- Page 219 and 220: Connecting to JDBC Resources from J
- Page 221 and 222: Configuring JMS Connection Factorie
- Page 223 and 224: Defining Connection Pool Properties
- Page 225 and 226: Obtaining JMS Connection Factories
- Page 227 and 228: JMS and Transactions and its accomp
- Page 229 and 230: JMS and Transactions For instance:
- Page 231 and 232: 220 BES Developer’s Guide
- Page 233 and 234: Configuring JMS administered object
- Page 235 and 236: Tibco Creating Clustered JMS Servic
- Page 237 and 238: Sonic serverUrl String localhost:72
- Page 239 and 240: Sonic Creating Clustered JMS Servic
- Page 241 and 242: OpenJMS Even though OpenJMS can be
- Page 243 and 244: OpenJMS Important If you use OpenJM
- Page 245 and 246: OpenJMS openjms.clean_messages_on_s
- Page 247 and 248: OpenJMS Table 24.1 Property Name De
- Page 249 and 250: Other JMS providers The following a
- Page 251 and 252: 240 BES Developer’s Guide
- Page 253 and 254: Creating the Interceptor Class For
- Page 255 and 256: Creating the JAR file Creating the
- Page 257 and 258: Components Components The Connector
- Page 259 and 260: System Contracts Connection Managem
- Page 261 and 262: System Contracts Security Managemen
- Page 263 and 264: Common Client Interface (CCI) Conne
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