Index: src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.java
===================================================================
--- src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.java	(revision 930179)
+++ src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.java	(working copy)
@@ -678,7 +678,16 @@
      * @throws SQLException if an SQL error occurs.
      */
     protected DbNameIndex createDbNameIndex() throws SQLException {
-        return new DbNameIndex(connectionManager, schemaObjectPrefix);
+        ConnectionRecoveryManager dedicatedConnection;
+        try {
+            dedicatedConnection = new ConnectionRecoveryManager(blockOnConnectionLoss,
+                    getDriver(), getUrl(), getUser(), getPassword());
+        } catch (RepositoryException e) {
+            SQLException exception = new SQLException("Could not created ConnectionRecoveryManager instance");
+            exception.initCause(e);
+            throw exception;
+        }
+        return new DbNameIndex(dedicatedConnection, schemaObjectPrefix);
     }
 
     /**
Index: src/main/java/org/apache/jackrabbit/core/persistence/bundle/OraclePersistenceManager.java
===================================================================
--- src/main/java/org/apache/jackrabbit/core/persistence/bundle/OraclePersistenceManager.java	(revision 930179)
+++ src/main/java/org/apache/jackrabbit/core/persistence/bundle/OraclePersistenceManager.java	(working copy)
@@ -19,7 +19,10 @@
 import java.sql.DatabaseMetaData;
 import java.sql.SQLException;
 
+import javax.jcr.RepositoryException;
+
 import org.apache.jackrabbit.core.persistence.PMContext;
+import org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager;
 import org.apache.jackrabbit.core.persistence.bundle.util.DbNameIndex;
 import org.apache.jackrabbit.core.persistence.bundle.util.NGKDbNameIndex;
 import org.apache.jackrabbit.util.Text;
@@ -124,7 +127,16 @@
      * @throws SQLException if an SQL error occurs.
      */
     protected DbNameIndex createDbNameIndex() throws SQLException {
-        return new NGKDbNameIndex(connectionManager, schemaObjectPrefix);
+        ConnectionRecoveryManager dedicatedConnection;
+        try {
+            dedicatedConnection = new ConnectionRecoveryManager(blockOnConnectionLoss,
+                    getDriver(), getUrl(), getUser(), getPassword());
+        } catch (RepositoryException e) {
+            SQLException exception = new SQLException("Could not created ConnectionRecoveryManager instance");
+            exception.initCause(e);
+            throw exception;
+        }
+        return new NGKDbNameIndex(dedicatedConnection, schemaObjectPrefix);
     }
 
     /**
Index: src/main/java/org/apache/jackrabbit/core/persistence/bundle/PostgreSQLPersistenceManager.java
===================================================================
--- src/main/java/org/apache/jackrabbit/core/persistence/bundle/PostgreSQLPersistenceManager.java	(revision 930179)
+++ src/main/java/org/apache/jackrabbit/core/persistence/bundle/PostgreSQLPersistenceManager.java	(working copy)
@@ -18,6 +18,7 @@
 
 import org.apache.jackrabbit.core.NodeId;
 import org.apache.jackrabbit.core.persistence.PMContext;
+import org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager;
 import org.apache.jackrabbit.core.persistence.bundle.util.DbNameIndex;
 import org.apache.jackrabbit.core.persistence.bundle.util.NodePropBundle;
 import org.apache.jackrabbit.core.persistence.bundle.util.PostgreSQLNameIndex;
@@ -32,6 +33,8 @@
 import java.sql.SQLException;
 import java.sql.Statement;
 
+import javax.jcr.RepositoryException;
+
 /**
  * Extends the {@link BundleDbPersistenceManager} by PostgreSQL specific code.
  * <p/>
@@ -77,7 +80,16 @@
      * @throws java.sql.SQLException if an SQL error occurs.
      */
     protected DbNameIndex createDbNameIndex() throws SQLException {
-        return new PostgreSQLNameIndex(connectionManager, schemaObjectPrefix);
+        ConnectionRecoveryManager dedicatedConnection;
+        try {
+            dedicatedConnection = new ConnectionRecoveryManager(blockOnConnectionLoss,
+                    getDriver(), getUrl(), getUser(), getPassword());
+        } catch (RepositoryException e) {
+            SQLException exception = new SQLException("Could not created ConnectionRecoveryManager instance");
+            exception.initCause(e);
+            throw exception;
+        }
+        return new PostgreSQLNameIndex(dedicatedConnection, schemaObjectPrefix);
     }
 
     /**
Index: src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/DbNameIndex.java
===================================================================
--- src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/DbNameIndex.java	(revision 930179)
+++ src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/DbNameIndex.java	(working copy)
@@ -28,8 +28,7 @@
  * Implements a {@link StringIndex} that stores and retrieves the names from a
  * table in a database.
  * <p/>
- * Note that this class is not threadsafe by itself. it needs to be synchronized
- * by the using application.
+ * Note that this class is threadsafe. 
  * <p/>
  * Due to a bug with oracle that treats empty strings a null values
  * (see JCR-815), all empty strings are replaced by a ' '. since names never
@@ -53,7 +52,7 @@
 
     /**
      * Creates a new index that is stored in a db.
-     * @param con the jdbc connection
+     * @param conMgr The dedicated connection manager for this instance.
      * @param schemaObjectPrefix the prefix for table names
      * @throws SQLException if the statements cannot be prepared.
      */
@@ -66,7 +65,6 @@
     /**
      * Inits this index and prepares the statements.
      *
-     * @param con the jdbc connection
      * @param schemaObjectPrefix the prefix for table names
      * @throws SQLException if the statements cannot be prepared.
      */
@@ -80,15 +78,14 @@
     /**
      * Closes this index and releases it's resources.
      */
-    public void close() {
-        // closing the database resources is done by the owning
-        // BundleDbPersistenceManager that created this index
+    public synchronized void close() {
+        connectionManager.close();
     }
 
     /**
      * {@inheritDoc}
      */
-    public int stringToIndex(String string) {
+    public synchronized int stringToIndex(String string) {
         // check cache
         Integer index = (Integer) string2Index.get(string);
         if (index == null) {
@@ -109,7 +106,7 @@
     /**
      * {@inheritDoc}
      */
-    public String indexToString(int idx) throws IllegalArgumentException {
+    public synchronized String indexToString(int idx) throws IllegalArgumentException {
         // check cache
         Integer index = new Integer(idx);
         String s = (String) index2String.get(index);
@@ -130,7 +127,7 @@
      * @param string the string to insert
      * @return the new index.
      */
-    protected int insertString(String string) {
+    protected synchronized int insertString(String string) {
         // assert index does not exist
         int result = -1;
         try {
@@ -163,7 +160,7 @@
      * @param string the string to retrieve the index for
      * @return the index or -1 if not found.
      */
-    protected int getIndex(String string) {
+    protected synchronized int getIndex(String string) {
         try {
             Statement stmt = connectionManager.executeStmt(
                     indexSelectSQL, new Object[] { string });
@@ -191,7 +188,7 @@
      * @return the string
      * @throws IllegalArgumentException if the string is not found
      */
-    protected String getString(int index)
+    protected synchronized String getString(int index)
             throws IllegalArgumentException, IllegalStateException {
         String result = null;
         try {
Index: src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/NGKDbNameIndex.java
===================================================================
--- src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/NGKDbNameIndex.java	(revision 930179)
+++ src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/NGKDbNameIndex.java	(working copy)
@@ -27,7 +27,7 @@
 
     /**
      * Creates a new index that is stored in a db.
-     * @param con the ConnectionRecoveryManager
+     * @param conMgr The dedicated connection manager for this instance.
      * @param schemaObjectPrefix the prefix for table names
      * @throws SQLException if the statements cannot be prepared.
      */
@@ -55,7 +55,7 @@
      * @param string the string to insert
      * @return the new index.
      */
-    protected int insertString(String string) {
+    protected synchronized int insertString(String string) {
         // assert index does not exist
         try {
             connectionManager.executeStmt(nameInsertSQL, new Object[] { string });
Index: src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/PostgreSQLNameIndex.java
===================================================================
--- src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/PostgreSQLNameIndex.java	(revision 930179)
+++ src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/PostgreSQLNameIndex.java	(working copy)
@@ -28,6 +28,12 @@
 
     protected String generatedKeySelectSQL;
 
+    /**
+     * Creates a new index that is stored in a db.
+     * @param conMgr The dedicated connection manager for this instance.
+     * @param schemaObjectPrefix the prefix for table names
+     * @throws SQLException if the statements cannot be prepared.
+     */
     public PostgreSQLNameIndex(ConnectionRecoveryManager conMgr, String schemaObjectPrefix)
             throws SQLException {
         super(conMgr, schemaObjectPrefix);
@@ -36,7 +42,6 @@
     /**
      * Inits this index and prepares the statements.
      *
-     * @param con the jdbc connection
      * @param schemaObjectPrefix the prefix for table names
      * @throws SQLException if the statements cannot be prepared.
      */
@@ -57,7 +62,7 @@
      * @param string the string to insert
      * @return the new index.
      */
-    protected int insertString(String string) {
+    protected synchronized int insertString(String string) {
         // assert index does not exist
         try {
             connectionManager.executeStmt(nameInsertSQL, new Object[]{string});
@@ -73,7 +78,7 @@
      * Retrieves the last assigned key from the database.
      * @return the index.
      */
-    protected int getGeneratedKey() {
+    protected synchronized int getGeneratedKey() {
         try {
             ResultSet rs = connectionManager.executeQuery(generatedKeySelectSQL);
             try {
