geronimo-scm mailing list archives

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

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

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

Modified: geronimo/server/branches/2.2/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java?rev=1165517&r1=1165516&r2=1165517&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java
(original)
+++ geronimo/server/branches/2.2/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java
Tue Sep  6 07:08:40 2011
@@ -188,7 +188,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