Changes between Version 1 and Version 2 of Ticket #136


Ignore:
Timestamp:
02/18/2013 10:18:29 AM (13 years ago)
Author:
yuanhuoqing
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #136 – Description

    v1 v2  
    99</database> 
    1010}}} 
    11      参数<prepared-statement-cache-size>8</prepared-statement-cache-size>即是启用preparestatment cache,默认是不启用的,即这个值为0 
     11     参数<prepared-statement-cache-size>8</prepared-statement-cache-size>即是启用preparestatment cache,默认是不启用的,即值为0,去掉这行配置测试不会出现这个异常 
    1212    PreparedStatement是JDBC里面提供的对象,很多连接池都引入了PreparedStatementCache的概念。如Jboss连接池、C3P0,DBCP等。PreparedStatementCache即用于保存与数据库交互的prepareStatement对象。在cache里的ps对象,不需要重新走一次DBMS连接请求去创建。  
    1313    PreparedStatementCache是跟着connection走的。一个connection就会有一个cache。比如一个cache允许缓存20条语句,20个connection就可能缓存400个。一般连接池可以支持这个的配置,能提高性能,但会占用较大内存,同时增加表字段时如果不重启应用会报异常:java.sql.SQLException: 违反协议,需要重启应用才能解决,所以一般不建议启用PreparedStatementCache。