- 论坛徽章:
- 0
|
本帖最后由 三人行必有吾师 于 2012-02-27 08:01 编辑
其实,这里的讨论,已经很多都涉及到书的内容了;另外,还想起一句长辈常常叮嘱的古话:“书是死的,人是活的” 
比如,楼上有同仁提到JDBC调优时比较共性的一个做法
“2.3 JDBC调优
增加Statement Cache Size对于大量使用PreparedStatement对象的应用程序很有帮助,WebLogic能够为每一个连接缓存这些对象,此值默认为10。在保证数据库游标大小足够的前提下,可以根据需要提高Statement Cache Size ”
大多数情况下是OK的,但在一些特殊情况下,反而恰恰是要关闭WebLogic控制台上的Statement Cache,比如使用Informix驱动时:
Informix Limitation for Prepared Statements
If anything causes a change to a database table or procedure, such as adding an index, or recompiling the procedure, all existing JDBC PreparedStatements that access it must be re-prepared before they can be used again. This is a limitation of the Informix database management system. WebLogic Server caches, retains, and reuses application PreparedStatements along with pooled connections, so if your application uses prepared statements that access tables or procedures that are dropped and recreated or for which the definition is changed, re-execution of a cached prepared statement will fail once. WebLogic Server will then remove the defunct prepared statement from the cache and replace it when the application asks for the statement again.
To avoid any PreparedStatement failure due to table or procedure changes in the DBMS while WebLogic Server is running, set the Statement Cache Size to 0. WebLogic will make a new PreparedStatement for each request. However, with the statement cache disabled, you will lose the performance benefit of statement caching.
这个时候,可以在连接参数里,开启Informix驱动自身的Cache,比如:- i) InsensitiveResultSetBufferSiz=20480
- ii) MaxPooledStatements=50
复制代码 |
|