jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marti...@apache.org
Subject svn commit: r814570 - in /jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core: fs/db/DbFileSystem.java journal/DatabaseJournal.java persistence/bundle/BundleDbPersistenceManager.java
Date Mon, 14 Sep 2009 10:42:43 GMT
Author: martijnh
Date: Mon Sep 14 10:42:43 2009
New Revision: 814570

URL: http://svn.apache.org/viewvc?rev=814570&view=rev
Log:
JCR-1456 Database connection pooling

* DbType config from DataSource configuration overrides dbType set at component but
  only if that configuration exists.

Modified:
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/DbFileSystem.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/DatabaseJournal.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.java

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/DbFileSystem.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/DbFileSystem.java?rev=814570&r1=814569&r2=814570&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/DbFileSystem.java
(original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/DbFileSystem.java
Mon Sep 14 10:42:43 2009
@@ -212,7 +212,10 @@
         if (getDataSourceName() == null || "".equals(getDataSourceName())) {
             return ConnectionFactory.getDataSource(getDriver(), getUrl(), getUser(), getPassword());
         } else {
-            setSchema(ConnectionFactory.getDataBaseType(dataSourceName));
+            String dbType = ConnectionFactory.getDataBaseType(dataSourceName);
+            if (DatabaseFileSystem.class.getResourceAsStream(dbType + ".ddl") != null) {
+                setSchema(dbType);
+            }
             return ConnectionFactory.getDataSource(dataSourceName);
         }
     }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/DatabaseJournal.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/DatabaseJournal.java?rev=814570&r1=814569&r2=814570&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/DatabaseJournal.java
(original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/DatabaseJournal.java
Mon Sep 14 10:42:43 2009
@@ -321,7 +321,10 @@
         }
         if (dataSourceName != null) {
             try {
-                databaseType = ConnectionFactory.getDataBaseType(dataSourceName);
+                String configuredDatabaseType = ConnectionFactory.getDataBaseType(dataSourceName);
+                if (DatabaseJournal.class.getResourceAsStream(configuredDatabaseType + ".ddl")
!= null) {
+                    setDatabaseType(configuredDatabaseType);
+                }
             } catch (RepositoryException e) {
                 throw new JournalException("failed to get database type", e);
             }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.java?rev=814570&r1=814569&r2=814570&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.java
(original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.java
Mon Sep 14 10:42:43 2009
@@ -25,7 +25,6 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.sql.Blob;
-import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.ArrayList;
@@ -532,7 +531,10 @@
         if (getDataSourceName() == null || "".equals(getDataSourceName())) {
             return ConnectionFactory.getDataSource(getDriver(), getUrl(), getUser(), getPassword());
         } else {
-            setDatabaseType(ConnectionFactory.getDataBaseType(dataSourceName));
+            String dbType = ConnectionFactory.getDataBaseType(dataSourceName);
+            if (BundleDbPersistenceManager.class.getResourceAsStream(dbType + ".ddl") !=
null) {
+                setDatabaseType(dbType);
+            }
             return ConnectionFactory.getDataSource(dataSourceName);
         }
     }



Mime
View raw message