Browse Source

use mysql connection props as used in gemini project

Simon Oberhammer 11 years ago
parent
commit
2164d5cb8d
2 changed files with 4 additions and 2 deletions
  1. 2 1
      ringojs-convenient/app/models.js
  2. 2 1
      ringojs/ringo-main.js

+ 2 - 1
ringojs-convenient/app/models.js

@@ -6,8 +6,9 @@ var dbHost = '172.16.98.98';
 
 
 // create and configure store
 // create and configure store
 var connectionPool = module.singleton("connectionPool", function() {
 var connectionPool = module.singleton("connectionPool", function() {
+    var mysqlConnectionProperties = "?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useServerPrepStmts&enableQueryTimeouts=false&useUnbufferedIO=false&useReadAheadInput=false&maintainTimeStats=false&cacheRSMetadata=true";
     return new ConnectionPool({
     return new ConnectionPool({
-        "url": "jdbc:mysql://" + dbHost + "/hello_world",
+        "url": "jdbc:mysql://" + dbHost + "/hello_world" + mysqlConnectionProperties,
         "driver": "com.mysql.jdbc.Driver",
         "driver": "com.mysql.jdbc.Driver",
         "username": "benchmarkdbuser",
         "username": "benchmarkdbuser",
         "password": "benchmarkdbpass"
         "password": "benchmarkdbpass"

+ 2 - 1
ringojs/ringo-main.js

@@ -120,7 +120,8 @@ exports.app = function(req) {
 
 
 
 
 var datasource = module.singleton('pooling-datasource', function() {
 var datasource = module.singleton('pooling-datasource', function() {
-  return sql.connect("jdbc:mysql://" + dbHost + "/hello_world", 'benchmarkdbuser', 'benchmarkdbpass');
+  var mysqlConnectionProperties = "?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useServerPrepStmts&enableQueryTimeouts=false&useUnbufferedIO=false&useReadAheadInput=false&maintainTimeStats=false&cacheRSMetadata=true";
+  return sql.connect("jdbc:mysql://" + dbHost + "/hello_world" + mysqlConnectionProperties, 'benchmarkdbuser', 'benchmarkdbpass');
 });
 });
 
 
 if (require.main == module) {
 if (require.main == module) {