geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From viol...@apache.org
Subject svn commit: r1165512 - /geronimo/server/branches/2.1/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java
Date Tue, 06 Sep 2011 06:48:50 GMT
Author: violalu
Date: Tue Sep  6 06:48:50 2011
New Revision: 1165512

URL: http://svn.apache.org/viewvc?rev=1165512&view=rev
Log:
GERONIMO-6146 fix classcast exception when creating oracle rac datasource

Modified:
    geronimo/server/branches/2.1/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java

Modified: geronimo/server/branches/2.1/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java?rev=1165512&r1=1165511&r2=1165512&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java
(original)
+++ geronimo/server/branches/2.1/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java
Tue Sep  6 06:48:50 2011
@@ -21,6 +21,7 @@ import java.lang.reflect.Constructor;
 import java.util.HashMap;
 import java.util.LinkedHashSet;
 import java.util.Map;
+import java.util.Properties;
 
 import javax.resource.ResourceException;
 import javax.resource.spi.ManagedConnectionFactory;
@@ -190,7 +191,24 @@ public class ManagedConnectionFactoryWra
         ClassLoader oldTCL = thread.getContextClassLoader();
         thread.setContextClassLoader(classLoader);
         try {
-            delegate.setAttribute(name, value);
+        	//Convert java.util.Properties to java.lang.String
+        	if(value != null && value instanceof Properties){
+        		Properties ps = (Properties) value;
+				if (!ps.isEmpty()) {
+					String s = null;
+					for (Object o : ps.keySet()) {
+						String k = (String) o;
+						String v = ps.getProperty(k);
+						s = k + "=" + v + ",";
+						log.debug("Setting " + k + "=" + value);
+					}
+					delegate.setAttribute(name, s);
+					log.debug("Setting " + name + " value " + s);
+				}        		
+        	} else {        		
+        		delegate.setAttribute(name, value);
+        		log.debug("Setting " + name + " value " + value);
+        	}
         } finally {
             thread.setContextClassLoader(oldTCL);
         }



Mime
View raw message