Browse Source

use statement cache in Tomcat JDBC pool
- Mysql JDBC driver causes a lot of SQLExceptions internally which cause a lot of overhead

Lari Hotari 11 years ago
parent
commit
e6c8cee842

+ 1 - 1
grails/hello/grails-app/conf/DataSource.groovy

@@ -25,7 +25,7 @@ dataSource {
         testOnReturn=false
         validationQuery="/* ping */"
         validationInterval=15000
-        jdbcInterceptors="ConnectionState"
+        jdbcInterceptors="ConnectionState;StatementCache"
         defaultTransactionIsolation = java.sql.Connection.TRANSACTION_READ_UNCOMMITTED
         dbProperties = this.loadProperties("classpath:mysql-connection.properties")
     }

+ 3 - 2
grails/hello/grails-app/conf/mysql-connection.properties

@@ -12,6 +12,7 @@ useUnicode=false
 #characterEncoding=Cp1252
 
 #dumpQueriesOnException=true
+
 dontTrackOpenResources=true
 
 #useCompression=true
@@ -34,8 +35,8 @@ metadataCacheSize=100
 useServerPrepStmts=false
 
 # prepared statement caching on JDBC client
-cachePrepStmts=true
-cacheCallableStmts=true
+cachePrepStmts=false
+cacheCallableStmts=false
 prepStmtCacheSize=4096
 prepStmtCacheSqlLimit=32000