user manual

Chapter 22: Using JDBC 237
Defining the Connection Pool Properties for a JDBC Datasource
maxPreparedS
tatementsPer
Query
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
.prepareStatement()
calls result in non-
cached instances of
PreparedStatement
objects created and
returned to the
caller. Note that like
maxPreparedStatement
CacheSize, this
property is only
effective when the
reuseStatements
property of the
datasource is set to
true (default).
20
Name
Allowed
Values
Description
Default
Value
connect
ionType
Enumera
ted:
Direct
XA
Indicates type
transaction
association of all
connections
retrieved from the
connection pool,
whether "Direct"
or "XA"
Not Applicable.
Property
specification is
mandatory