|
@@ -1,31 +1,50 @@
|
|
|
|
+import org.springframework.beans.factory.config.PropertiesFactoryBean
|
|
|
|
+import org.springframework.core.io.support.ResourceArrayPropertyEditor
|
|
|
|
+
|
|
dataSource {
|
|
dataSource {
|
|
pooled = true
|
|
pooled = true
|
|
dbCreate = "update"
|
|
dbCreate = "update"
|
|
- url = "jdbc:mysql://localhost:3306/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true"
|
|
|
|
|
|
+ url = "jdbc:mysql://localhost:3306/hello_world"
|
|
driverClassName = "com.mysql.jdbc.Driver"
|
|
driverClassName = "com.mysql.jdbc.Driver"
|
|
dialect = org.hibernate.dialect.MySQL5InnoDBDialect
|
|
dialect = org.hibernate.dialect.MySQL5InnoDBDialect
|
|
username = "benchmarkdbuser"
|
|
username = "benchmarkdbuser"
|
|
password = "benchmarkdbpass"
|
|
password = "benchmarkdbpass"
|
|
-
|
|
|
|
- properties {
|
|
|
|
- maxActive = 256
|
|
|
|
- maxIdle = 25
|
|
|
|
- minIdle = 5
|
|
|
|
- initialSize = 5
|
|
|
|
- minEvictableIdleTimeMillis = 60000
|
|
|
|
- timeBetweenEvictionRunsMillis = 60000
|
|
|
|
- maxWait = 10000
|
|
|
|
- numTestsPerEvictionRun=3
|
|
|
|
- testOnBorrow=false
|
|
|
|
- testWhileIdle=true
|
|
|
|
- testOnReturn=false
|
|
|
|
- validationQuery="/* ping */"
|
|
|
|
- jdbcInterceptors="ConnectionState"
|
|
|
|
- }
|
|
|
|
|
|
+ properties {
|
|
|
|
+ fairQueue = false
|
|
|
|
+ maxActive = 256
|
|
|
|
+ maxIdle = 25
|
|
|
|
+ minIdle = 5
|
|
|
|
+ initialSize = 5
|
|
|
|
+ minEvictableIdleTimeMillis = 60000
|
|
|
|
+ timeBetweenEvictionRunsMillis = 60000
|
|
|
|
+ maxWait = 10000
|
|
|
|
+ maxAge = 1800 * 1000
|
|
|
|
+ numTestsPerEvictionRun=3
|
|
|
|
+ testOnBorrow=false
|
|
|
|
+ testWhileIdle=true
|
|
|
|
+ testOnReturn=false
|
|
|
|
+ validationQuery="/* ping */"
|
|
|
|
+ validationInterval=15000
|
|
|
|
+ jdbcInterceptors="ConnectionState"
|
|
|
|
+ defaultTransactionIsolation = java.sql.Connection.TRANSACTION_READ_UNCOMMITTED
|
|
|
|
+ dbProperties = this.loadProperties("classpath:mysql-connection.properties")
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
hibernate {
|
|
hibernate {
|
|
// Purposely turning off query cache
|
|
// Purposely turning off query cache
|
|
cache.use_second_level_cache = false
|
|
cache.use_second_level_cache = false
|
|
cache.use_query_cache = false
|
|
cache.use_query_cache = false
|
|
cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory'
|
|
cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory'
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+static Properties loadProperties(String path) {
|
|
|
|
+ PropertiesFactoryBean pfb=new PropertiesFactoryBean()
|
|
|
|
+ pfb.setIgnoreResourceNotFound(true)
|
|
|
|
+ def converter=new ResourceArrayPropertyEditor()
|
|
|
|
+ converter.setAsText(path)
|
|
|
|
+ pfb.setLocations(converter.getValue())
|
|
|
|
+ pfb.afterPropertiesSet()
|
|
|
|
+ return pfb.object
|
|
|
|
+}
|
|
|
|
+
|