12.11.2014 Views

web server - Borland Technical Publications

web server - Borland Technical Publications

web server - Borland Technical Publications

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Defining the Connection Pool Properties for a JDBC Datasource<br />

Table 22.1<br />

maxPreparedStatemen<br />

tCacheSize<br />

Connection Pool Properties for a JDBC Datasource (continued)<br />

Name Allowed Values Description Default Value<br />

Integer<br />

Each connection within a BES<br />

JDBC pool caches<br />

java.sql.PreparedStatement objects<br />

for reuse.<br />

Each PreparedStatement cache is<br />

organized by SQL literal strings<br />

representing unique SQL<br />

statement requests.<br />

This property limits the number of<br />

PreparedStatements cached per<br />

pooled JDBC connection. It<br />

specifies the maximum size of the<br />

cache. If a cache reaches the limit,<br />

any subsequent<br />

javax.sql.Connection.prepareStatem<br />

ent() calls result in non-cached<br />

instances of PreparedStatement<br />

objects being created and<br />

returned to the caller. The lifecycle<br />

of the cache is the same as the<br />

JDBC connection lifecycle. For<br />

example, if an idle connection<br />

times out, both the connection and<br />

its PreparedStatement cache are<br />

discarded. Unresolved<br />

parameterized SQL statements<br />

are cached, for example, the<br />

statement SELECT NAME FROM<br />

CUSTOMER WHERE AGE=20 is cached as<br />

SELECT NAME FROM CUSTOMER WHERE<br />

:age='?'. Note that this property is<br />

only effective when the<br />

reuseStatements property of the<br />

datasource is set to true (default).<br />

The default value is 40, which is<br />

usually sufficient for applications.<br />

40<br />

202 BES Developer’s Guide

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

Saved successfully!

Ooh no, something went wrong!