Technical data

16 Managing JDBC Connectivity
16-32 Administration Guide
Increasing Performance with the Prepared
Statement Cache
For each connection pool that you create in WebLogic Server, you can specify a
prepared statement cache size. When you set the prepared statement cache size,
WebLogic Server stores each prepared statement used in applications and EJBs until
it reaches the number of prepared statements that you specify. Statements are cached
per connection, not per connection pool. For example, if you set the prepared statement
cache size to 10, WebLogic Server will store the first 10 prepared statements called by
applications or EJBs using that particular connection.
When an application or EJB calls any of the prepared statements stored in the cache,
WebLogic Server reuses the statement stored in the cache. Reusing prepared
statements eliminates the need for parsing statements in the database, which reduces
CPU usage on the database machine, improving performance for the current statement
and leaving CPU cycles for other tasks.
The default value for prepared statement cache size is
0. You can use the following
methods to set the prepared statement cache size for a connection pool:
n Using the Administration Console. See JDBC Connection Pool in the
Administration Console Online Help at
http://e-docs.bea.com/wls/docs61/ConsoleHelp/jdbcconnectionpool
.html
.
n Using the WebLogic management API. See the
getPreparedStatementCacheSize() and setPreparedStatementCacheSize(int
cacheSize)
methods in the Javadocs for WebLogic Classes at
Confirm if a Connection
Pool was created
EXISTS_POOL
Reset a Connection Pool
RESET_POOL
Table 16-22 Managing Connection Pools with the Command-Line Interface
If you want to . . . Then use this command . . .