openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r696512 - /openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCConfigurationImpl.java
Date Wed, 17 Sep 2008 23:21:26 GMT
Author: ppoddar
Date: Wed Sep 17 16:21:25 2008
New Revision: 696512

URL: http://svn.apache.org/viewvc?rev=696512&view=rev
Log:
Use username/password for triall connection to slices.

Modified:
    openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCConfigurationImpl.java

Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCConfigurationImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCConfigurationImpl.java?rev=696512&r1=696511&r2=696512&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCConfigurationImpl.java
(original)
+++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCConfigurationImpl.java
Wed Sep 17 16:21:25 2008
@@ -218,7 +218,7 @@
                 DecoratingDataSource dds = new DecoratingDataSource(ds);
                 ds = DataSourceFactory.installDBDictionary(
                         conf.getDBDictionaryInstance(), dds, conf, false);
-                if (verifyDataSource(slice, ds)) {
+                if (verifyDataSource(slice, ds, conf)) {
                     dataSources.add(ds);
                     isXA &= isXACompliant(ds);
                 }
@@ -254,10 +254,12 @@
      * Verify that a connection can be established to the given slice. If
      * connection can not be established then slice is set to INACTIVE state.
      */
-    private boolean verifyDataSource(Slice slice, DataSource ds) {
+    private boolean verifyDataSource(Slice slice, DataSource ds, 
+    		JDBCConfiguration conf) {
         Connection con = null;
         try {
-            con = ds.getConnection();
+            con = ds.getConnection(conf.getConnectionUserName(), 
+            		conf.getConnectionPassword());
             slice.setStatus(Slice.Status.ACTIVE);
             if (con == null) {
                 slice.setStatus(Slice.Status.INACTIVE);



Mime
View raw message