List:Commits« Previous MessageNext Message »
From:mmatthews Date:June 21 2007 4:56pm
Subject:Connector/J commit: r6453 - in branches: branch_5_0/connector-j branch_5_0/connector-j/src/com/mysql/jdbc branch_5_0/connector-j/src/com/mysql/jdbc/co...
View as plain text  
Added:
   branches/branch_5_0/connector-j/src/com/mysql/jdbc/configs/coldFusion.properties
   branches/branch_5_1/connector-j/src/com/mysql/jdbc/configs/coldFusion.properties
Modified:
   branches/branch_5_0/connector-j/CHANGES
   branches/branch_5_0/connector-j/src/com/mysql/jdbc/NonRegisteringDriver.java
   branches/branch_5_0/connector-j/src/com/mysql/jdbc/Util.java
   branches/branch_5_1/connector-j/CHANGES
   branches/branch_5_1/connector-j/src/com/mysql/jdbc/NonRegisteringDriver.java
   branches/branch_5_1/connector-j/src/com/mysql/jdbc/Util.java
Log:
Driver detects when it is running in a ColdFusion MX server (tested
	  with version 7), and uses the configuration bundle "coldFusion",
	  which sets useDynamicCharsetInfo to "false" (see previous entry), and 
	  sets useLocalSessionState and autoReconnect to "true".

Modified: branches/branch_5_0/connector-j/CHANGES
===================================================================
--- branches/branch_5_0/connector-j/CHANGES	2007-06-15 01:25:41 UTC (rev 6452)
+++ branches/branch_5_0/connector-j/CHANGES	2007-06-21 16:56:08 UTC (rev 6453)
@@ -68,6 +68,11 @@
 	  ResultSetMetadata.isCaseSensitive() much more efficient, which leads
 	  to performance increase for ColdFusion, which calls this method for
 	  every column on every table it sees, it appears).
+	  
+	- Driver detects when it is running in a ColdFusion MX server (tested
+	  with version 7), and uses the configuration bundle "coldFusion",
+	  which sets useDynamicCharsetInfo to "false" (see previous entry), and 
+	  sets useLocalSessionState and autoReconnect to "true".
 	  	                    
 05-15-07 - Version 5.0.6
 

Modified: branches/branch_5_0/connector-j/src/com/mysql/jdbc/NonRegisteringDriver.java
===================================================================
--- branches/branch_5_0/connector-j/src/com/mysql/jdbc/NonRegisteringDriver.java	2007-06-15 01:25:41 UTC (rev 6452)
+++ branches/branch_5_0/connector-j/src/com/mysql/jdbc/NonRegisteringDriver.java	2007-06-21 16:56:08 UTC (rev 6453)
@@ -663,7 +663,23 @@
 						SQLError.SQL_STATE_INVALID_CONNECTION_ATTRIBUTE);
 			}
 		}
-
+		
+		if (Util.isColdFusion() &&
+				urlProps.getProperty("autoConfigureForColdFusion", "true").equalsIgnoreCase("true")) {
+			String configs = urlProps.getProperty(USE_CONFIG_PROPERTY_KEY);
+			
+			StringBuffer newConfigs = new StringBuffer();
+			
+			if (configs != null) {
+				newConfigs.append(configs);
+				newConfigs.append(",");
+			}
+			
+			newConfigs.append("coldFusion");
+			
+			urlProps.setProperty(USE_CONFIG_PROPERTY_KEY, newConfigs.toString());
+		}
+		
 		// If we use a config, it actually should get overridden by anything in
 		// the URL or passed-in properties
 

Modified: branches/branch_5_0/connector-j/src/com/mysql/jdbc/Util.java
===================================================================
--- branches/branch_5_0/connector-j/src/com/mysql/jdbc/Util.java	2007-06-15 01:25:41 UTC (rev 6452)
+++ branches/branch_5_0/connector-j/src/com/mysql/jdbc/Util.java	2007-06-21 16:56:08 UTC (rev 6453)
@@ -40,6 +40,8 @@
 
 	protected static Method systemNanoTimeMethod;
 	    
+	private static boolean isColdFusion = false;
+
 	static {
 		try {
 			systemNanoTimeMethod = System.class.getMethod("nanoTime", null);
@@ -48,8 +50,27 @@
 		} catch (NoSuchMethodException e) {
 			systemNanoTimeMethod = null;
 		}
+		
+		//
+		// Detect the ColdFusion MX environment
+		// 
+		// Unfortunately, no easy-to-discern classes are available
+		// to our classloader to check...
+		//
+		
+		String loadedFrom = stackTraceToString(new Throwable());
+		
+		if (loadedFrom != null) {
+			isColdFusion = loadedFrom.indexOf("coldfusion") != -1;
+		} else {
+			isColdFusion = false;
+		}
 	}
 	
+	public static boolean isColdFusion() {
+		return isColdFusion;
+	}
+	
 	protected static boolean nanoTimeAvailable() {
 		return systemNanoTimeMethod != null;
 	}

Added: branches/branch_5_0/connector-j/src/com/mysql/jdbc/configs/coldFusion.properties
===================================================================
--- branches/branch_5_0/connector-j/src/com/mysql/jdbc/configs/coldFusion.properties	2007-06-15 01:25:41 UTC (rev 6452)
+++ branches/branch_5_0/connector-j/src/com/mysql/jdbc/configs/coldFusion.properties	2007-06-21 16:56:08 UTC (rev 6453)
@@ -0,0 +1,25 @@
+#
+# Properties for optimal usage in ColdFusion
+#
+# Automagically pulled in if "autoConfigureForColdFusion" is "true"
+# which is the default configuration of the driver
+#
+
+#
+# CF uses a _lot_ of RSMD.isCaseSensitive() - this optimizes it
+#
+
+useDynamicCharsetInfo=false
+
+#
+# CF's pool tends to be "chatty" like DBCP
+#
+
+alwaysSendSetIsolation=false
+useLocalSessionState=true
+
+#
+# CF's pool seems to loose connectivity on page restart
+#
+
+autoReconnect=true

Modified: branches/branch_5_1/connector-j/CHANGES
===================================================================
--- branches/branch_5_1/connector-j/CHANGES	2007-06-15 01:25:41 UTC (rev 6452)
+++ branches/branch_5_1/connector-j/CHANGES	2007-06-21 16:56:08 UTC (rev 6453)
@@ -181,7 +181,12 @@
 	  ResultSetMetadata.isCaseSensitive() much more efficient, which leads
 	  to performance increase for ColdFusion, which calls this method for
 	  every column on every table it sees, it appears).
-	      
+  
+	- Driver detects when it is running in a ColdFusion MX server (tested
+	  with version 7), and uses the configuration bundle "coldFusion",
+	  which sets useDynamicCharsetInfo to "false" (see previous entry), and 
+	  sets useLocalSessionState and autoReconnect to "true".
+	  	      
 05-15-07 - Version 5.0.6
 
 	- Fixed BUG#25545 - Client options not sent correctly when using SSL,

Modified: branches/branch_5_1/connector-j/src/com/mysql/jdbc/NonRegisteringDriver.java
===================================================================
--- branches/branch_5_1/connector-j/src/com/mysql/jdbc/NonRegisteringDriver.java	2007-06-15 01:25:41 UTC (rev 6452)
+++ branches/branch_5_1/connector-j/src/com/mysql/jdbc/NonRegisteringDriver.java	2007-06-21 16:56:08 UTC (rev 6453)
@@ -663,6 +663,22 @@
 			}
 		}
 
+		if (Util.isColdFusion() &&
+				urlProps.getProperty("autoConfigureForColdFusion", "true").equalsIgnoreCase("true")) {
+			String configs = urlProps.getProperty(USE_CONFIG_PROPERTY_KEY);
+			
+			StringBuffer newConfigs = new StringBuffer();
+			
+			if (configs != null) {
+				newConfigs.append(configs);
+				newConfigs.append(",");
+			}
+			
+			newConfigs.append("coldFusion");
+			
+			urlProps.setProperty(USE_CONFIG_PROPERTY_KEY, newConfigs.toString());
+		}
+		
 		// If we use a config, it actually should get overridden by anything in
 		// the URL or passed-in properties
 

Modified: branches/branch_5_1/connector-j/src/com/mysql/jdbc/Util.java
===================================================================
--- branches/branch_5_1/connector-j/src/com/mysql/jdbc/Util.java	2007-06-15 01:25:41 UTC (rev 6452)
+++ branches/branch_5_1/connector-j/src/com/mysql/jdbc/Util.java	2007-06-21 16:56:08 UTC (rev 6453)
@@ -84,6 +84,8 @@
 	private static Util enclosingInstance = new Util();
 
 	private static boolean isJdbc4 = false;
+	
+	private static boolean isColdFusion = false;
 
 	static {
 		try {
@@ -99,6 +101,21 @@
 		} catch (Throwable t) {
 			isJdbc4 = false;
 		}
+		
+		//
+		// Detect the ColdFusion MX environment
+		// 
+		// Unfortunately, no easy-to-discern classes are available
+		// to our classloader to check...
+		//
+		
+		String loadedFrom = stackTraceToString(new Throwable());
+		
+		if (loadedFrom != null) {
+			isColdFusion = loadedFrom.indexOf("coldfusion") != -1;
+		} else {
+			isColdFusion = false;
+		}
 	}
 
 	// ~ Methods
@@ -107,6 +124,10 @@
 	public static boolean isJdbc4() {
 		return isJdbc4;
 	}
+	
+	public static boolean isColdFusion() {
+		return isColdFusion;
+	}
 
 	// Right from Monty's code
 	static String newCrypt(String password, String seed) {

Added: branches/branch_5_1/connector-j/src/com/mysql/jdbc/configs/coldFusion.properties
===================================================================
--- branches/branch_5_1/connector-j/src/com/mysql/jdbc/configs/coldFusion.properties	2007-06-15 01:25:41 UTC (rev 6452)
+++ branches/branch_5_1/connector-j/src/com/mysql/jdbc/configs/coldFusion.properties	2007-06-21 16:56:08 UTC (rev 6453)
@@ -0,0 +1,25 @@
+#
+# Properties for optimal usage in ColdFusion
+#
+# Automagically pulled in if "autoConfigureForColdFusion" is "true"
+# which is the default configuration of the driver
+#
+
+#
+# CF uses a _lot_ of RSMD.isCaseSensitive() - this optimizes it
+#
+
+useDynamicCharsetInfo=false
+
+#
+# CF's pool tends to be "chatty" like DBCP
+#
+
+alwaysSendSetIsolation=false
+useLocalSessionState=true
+
+#
+# CF's pool seems to loose connectivity on page restart
+#
+
+autoReconnect=true

Thread
Connector/J commit: r6453 - in branches: branch_5_0/connector-j branch_5_0/connector-j/src/com/mysql/jdbc branch_5_0/connector-j/src/com/mysql/jdbc/co...mmatthews21 Jun