- 論壇徽章:
- 0
|
本帖最后由 三人行必有吾師 于 2012-02-27 08:01 編輯
其實(shí),這里的討論,已經(jīng)很多都涉及到書(shū)的內(nèi)容了;另外,還想起一句長(zhǎng)輩常常叮囑的古話:“書(shū)是死的,人是活的” 
比如,樓上有同仁提到JDBC調(diào)優(yōu)時(shí)比較共性的一個(gè)做法
“2.3 JDBC調(diào)優(yōu)
增加Statement Cache Size對(duì)于大量使用PreparedStatement對(duì)象的應(yīng)用程序很有幫助,WebLogic能夠?yàn)槊恳粋(gè)連接緩存這些對(duì)象,此值默認(rèn)為10。在保證數(shù)據(jù)庫(kù)游標(biāo)大小足夠的前提下,可以根據(jù)需要提高Statement Cache Size ”
大多數(shù)情況下是OK的,但在一些特殊情況下,反而恰恰是要關(guān)閉WebLogic控制臺(tái)上的Statement Cache,比如使用Informix驅(qū)動(dòng)時(shí):
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.
這個(gè)時(shí)候,可以在連接參數(shù)里,開(kāi)啟Informix驅(qū)動(dòng)自身的Cache,比如:- i) InsensitiveResultSetBufferSiz=20480
- ii) MaxPooledStatements=50
復(fù)制代碼 |
|