geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From viol...@apache.org
Subject svn commit: r1165574 - /geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapper.java
Date Tue, 06 Sep 2011 09:14:43 GMT
Author: violalu
Date: Tue Sep  6 09:14:42 2011
New Revision: 1165574

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

Modified:
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapper.java

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapper.java?rev=1165574&r1=1165573&r2=1165574&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapper.java
(original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapper.java
Tue Sep  6 09:14:42 2011
@@ -22,6 +22,7 @@ import java.util.HashMap;
 import java.util.LinkedHashSet;
 import java.util.Map;
 import java.util.Set;
+import java.util.Properties;
 
 import javax.resource.spi.ManagedConnectionFactory;
 import javax.resource.spi.ResourceAdapterAssociation;
@@ -206,7 +207,23 @@ 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()) {
+                    StringBuilder s = new StringBuilder();
+                    for (Object o : ps.keySet()) {
+                        String k = (String) o;
+                        String v = ps.getProperty(k);
+                        s = s.append(k).append("=").append(v).append(",");
+                    }
+                    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