Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/SimpleDbPersistenceManager.java
===================================================================
--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/SimpleDbPersistenceManager.java	(revision 739706)
+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/SimpleDbPersistenceManager.java	(working copy)
@@ -108,6 +108,18 @@
  *       &lt;param name="externalBLOBs" value="false"/&gt;
  *   &lt;/PersistenceManager&gt;
  * </pre>
+ * The following is a fragment from a sample configuration using Ingres:
+ * <pre>
+ *   &lt;PersistenceManager class="org.apache.jackrabbit.core.persistence.db.SimpleDbPersistenceManager"&gt;
+ *       &lt;param name="driver" value="com.ingres.jdbc.IngresDriver"/&gt;
+ *       &lt;param name="url" value="jdbc:ingres://localhost:II7/test"/&gt;
+ *       &lt;param name="schema" value="ingres"/&gt;
+ *       &lt;param name="user" value="ingres"/&gt;
+ *       &lt;param name="password" value="ingres"/&gt;
+ *       &lt;param name="schemaObjectPrefix" value="${wsp.name}_"/&gt;
+ *       &lt;param name="externalBLOBs" value="false"/&gt;
+ *   &lt;/PersistenceManager&gt;
+ * </pre>
  * JNDI can be used to get the connection. In this case, use the javax.naming.InitialContext as the driver,
  * and the JNDI name as the URL. If the user and password are configured in the JNDI resource,
  * they should not be configured here. Example JNDI settings:
Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/IngresPersistenceManager.java
===================================================================
--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/IngresPersistenceManager.java	(revision 0)
+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/IngresPersistenceManager.java	(revision 0)
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core.persistence.bundle;
+
+import org.apache.jackrabbit.core.NodeId;
+import org.apache.jackrabbit.core.persistence.PMContext;
+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;
+import org.apache.jackrabbit.core.persistence.bundle.util.TrackingInputStream;
+import org.apache.jackrabbit.core.state.ItemStateException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.DataInputStream;
+import java.io.InputStream;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+/**
+ * Extends the {@link BundleDbPersistenceManager} by Ingres specific code.
+ * <p/>
+ * Configuration:<br>
+ * <ul>
+ * <li>&lt;param name="{@link #setBundleCacheSize(String) bundleCacheSize}" value="8"/>
+ * <li>&lt;param name="{@link #setConsistencyCheck(String) consistencyCheck}" value="false"/>
+ * <li>&lt;param name="{@link #setMinBlobSize(String) minBlobSize}" value="0"/>
+ * <li>&lt;param name="{@link #setDriver(String) driver}" value="com.ingres.jdbc.IngresDriver"/>
+ * <li>&lt;param name="{@link #setUrl(String) url}" value=""/>
+ * <li>&lt;param name="{@link #setUser(String) user}" value=""/>
+ * <li>&lt;param name="{@link #setPassword(String) password}" value=""/>
+ * <li>&lt;param name="{@link #setSchema(String) schema}" value="ingres"/>
+ * <li>&lt;param name="{@link #setSchemaObjectPrefix(String) schemaObjectPrefix}" value=""/>
+ * <li>&lt;param name="{@link #setErrorHandling(String) errorHandling}" value=""/>
+ * </ul>
+ */
+public class IngresPersistenceManager extends BundleDbPersistenceManager {
+
+    /**
+     * Logger instance.
+     */
+    private static Logger log =
+        LoggerFactory.getLogger(IngresPersistenceManager.class);
+
+    /**
+     * {@inheritDoc}
+     */
+    public void init(PMContext context) throws Exception {
+        // init default values
+        if (getDriver() == null) {
+            setDriver("com.ingres.jdbc.IngresDriver");
+        }
+        if (getSchema() == null) {
+            setSchema("ingres");
+        }
+        super.init(context);
+    }
+
+}
Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/DbFileSystem.java
===================================================================
--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/DbFileSystem.java	(revision 739706)
+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/DbFileSystem.java	(working copy)
@@ -88,6 +88,17 @@
  *       &lt;param name="schemaObjectPrefix" value="rep_"/&gt;
  *   &lt;/FileSystem&gt;
  * </pre>
+ * The following is a fragment from a sample configuration using Ingres:
+ * <pre>
+ *   &lt;FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem"&gt;
+ *       &lt;param name="driver" value="com.ingres.jdbc.IngresDriver"/&gt;
+ *       &lt;param name="url" value="jdbc:ingres://localhost:II7/test"/&gt;
+ *       &lt;param name="schema" value="ingres"/&gt;
+ *       &lt;param name="user" value="ingres"/&gt;
+ *       &lt;param name="password" value="ingres"/&gt;
+ *       &lt;param name="schemaObjectPrefix" value="rep_"/&gt;
+ *   &lt;/FileSystem&gt;
+ * </pre>
  * JNDI can be used to get the connection. In this case, use the javax.naming.InitialContext as the driver,
  * and the JNDI name as the URL. If the user and password are configured in the JNDI resource,
  * they should not be configured here. Example JNDI settings:
Index: jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/persistence/db/ingres.ddl
===================================================================
--- jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/persistence/db/ingres.ddl	(revision 0)
+++ jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/persistence/db/ingres.ddl	(revision 0)
@@ -0,0 +1,22 @@
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You under the Apache License, Version 2.0
+#  (the "License"); you may not use this file except in compliance with
+#  the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+create table ${schemaObjectPrefix}NODE (NODE_ID char(36) not null, NODE_DATA long byte not null)
+create unique index ${schemaObjectPrefix}NODE_IDX on ${schemaObjectPrefix}NODE (NODE_ID)
+create table ${schemaObjectPrefix}PROP (PROP_ID varchar(1024) not null, PROP_DATA long byte not null)
+create unique index ${schemaObjectPrefix}PROP_IDX on ${schemaObjectPrefix}PROP (PROP_ID)
+create table ${schemaObjectPrefix}REFS (NODE_ID char(36) not null, REFS_DATA long byte not null)
+create unique index ${schemaObjectPrefix}REFS_IDX on ${schemaObjectPrefix}REFS (NODE_ID)
+create table ${schemaObjectPrefix}BINVAL (BINVAL_ID varchar(1024) not null, BINVAL_DATA long byte not null)
+create unique index ${schemaObjectPrefix}BINVAL_IDX on ${schemaObjectPrefix}BINVAL (BINVAL_ID)
Index: jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/persistence/bundle/ingres.ddl
===================================================================
--- jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/persistence/bundle/ingres.ddl	(revision 0)
+++ jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/persistence/bundle/ingres.ddl	(revision 0)
@@ -0,0 +1,20 @@
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You under the Apache License, Version 2.0
+#  (the "License"); you may not use this file except in compliance with
+#  the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+create table ${schemaObjectPrefix}BUNDLE (NODE_ID_HI bigint not null, NODE_ID_LO bigint not null, BUNDLE_DATA long byte not null, PRIMARY KEY (NODE_ID_HI, NODE_ID_LO))
+create table ${schemaObjectPrefix}REFS (NODE_ID_HI bigint not null, NODE_ID_LO bigint not null, REFS_DATA long byte not null, PRIMARY KEY (NODE_ID_HI, NODE_ID_LO))
+create table ${schemaObjectPrefix}BINVAL (BINVAL_ID varchar(64) not null, BINVAL_DATA long byte not null)
+create unique index ${schemaObjectPrefix}BINVAL_IDX on ${schemaObjectPrefix}BINVAL (BINVAL_ID)
+create sequence ${schemaObjectPrefix}seq_names_id
+create table ${schemaObjectPrefix}NAMES (ID INTEGER PRIMARY KEY WITH DEFAULT NEXT VALUE FOR ${schemaObjectPrefix}seq_names_id, NAME varchar(255) not null)
Index: jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/fs/db/ingres.ddl
===================================================================
--- jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/fs/db/ingres.ddl	(revision 0)
+++ jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/fs/db/ingres.ddl	(revision 0)
@@ -0,0 +1,16 @@
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You under the Apache License, Version 2.0
+#  (the "License"); you may not use this file except in compliance with
+#  the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+create table ${schemaObjectPrefix}FSENTRY (FSENTRY_PATH varchar(2048) not null, FSENTRY_NAME varchar(255) not null, FSENTRY_DATA long byte with null, FSENTRY_LASTMOD bigint not null, FSENTRY_LENGTH bigint not null)
+create unique index ${schemaObjectPrefix}FSENTRY_IDX on ${schemaObjectPrefix}FSENTRY (FSENTRY_PATH, FSENTRY_NAME)
Index: jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/data/db/ingres.properties
===================================================================
--- jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/data/db/ingres.properties	(revision 0)
+++ jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/data/db/ingres.properties	(revision 0)
@@ -0,0 +1,17 @@
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You under the Apache License, Version 2.0
+#  (the "License"); you may not use this file except in compliance with
+#  the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+driver=com.ingres.jdbc.IngresDriver
+createTable=CREATE TABLE ${tablePrefix}${table}(ID VARCHAR(255) PRIMARY KEY, LENGTH BIGINT, LAST_MODIFIED BIGINT, DATA LONG BYTE)
Index: jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/journal/ingres.ddl
===================================================================
--- jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/journal/ingres.ddl	(revision 0)
+++ jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/journal/ingres.ddl	(revision 0)
@@ -0,0 +1,22 @@
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You under the Apache License, Version 2.0
+#  (the "License"); you may not use this file except in compliance with
+#  the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+create table ${schemaObjectPrefix}JOURNAL (REVISION_ID BIGINT NOT NULL, JOURNAL_ID varchar(255), PRODUCER_ID varchar(255), REVISION_DATA long byte)
+create unique index ${schemaObjectPrefix}JOURNAL_IDX on ${schemaObjectPrefix}JOURNAL (REVISION_ID)
+create table ${schemaObjectPrefix}GLOBAL_REVISION (REVISION_ID BIGINT NOT NULL)
+create unique index ${schemaObjectPrefix}GLOBAL_REVISION_IDX on ${schemaObjectPrefix}GLOBAL_REVISION (REVISION_ID)
+create table ${schemaObjectPrefix}LOCAL_REVISIONS (JOURNAL_ID varchar(255) NOT NULL, REVISION_ID BIGINT NOT NULL)
+
+# Inserting the one and only revision counter record now helps avoiding race conditions
+insert into ${schemaObjectPrefix}GLOBAL_REVISION VALUES(0)
