jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r610219 - in /jackrabbit/branches/1.4: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/ jackrabbit-core/src/main/resources/org/apache/jackrabbi...
Date Tue, 08 Jan 2008 23:09:58 GMT
Author: jukka
Date: Tue Jan  8 15:09:55 2008
New Revision: 610219

URL: http://svn.apache.org/viewvc?rev=610219&view=rev
Log:
1.4: Merged revision 610214 (JCR-1295)

Added:
    jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/MSSqlDatabaseJournal.java
      - copied unchanged from r610214, jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/MSSqlDatabaseJournal.java
Modified:
    jackrabbit/branches/1.4/RELEASE-NOTES.txt
    jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/MSSqlPersistenceManager.java
    jackrabbit/branches/1.4/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/journal/mssql.ddl
    jackrabbit/branches/1.4/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/persistence/bundle/mssql.ddl

Modified: jackrabbit/branches/1.4/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.4/RELEASE-NOTES.txt?rev=610219&r1=610218&r2=610219&view=diff
==============================================================================
--- jackrabbit/branches/1.4/RELEASE-NOTES.txt (original)
+++ jackrabbit/branches/1.4/RELEASE-NOTES.txt Tue Jan  8 15:09:55 2008
@@ -260,6 +260,7 @@
   [JCR-1154] Database Data Store
   [JCR-1184] Introduce spellchecker functionality based on content in ...
   [JCR-1276] A Property and a Node Can Have the Same Name
+  [JCR-1295] Tablespace (Filegroup) support for MS SQL Server
 
   Improvements
   [JCR-314]  Fine grained locking in SharedItemStateManager

Modified: jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/MSSqlPersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/MSSqlPersistenceManager.java?rev=610219&r1=610218&r2=610219&view=diff
==============================================================================
--- jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/MSSqlPersistenceManager.java
(original)
+++ jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/MSSqlPersistenceManager.java
Tue Jan  8 15:09:55 2008
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.core.persistence.bundle;
 
-import org.apache.jackrabbit.core.persistence.PMContext;
+import org.apache.jackrabbit.util.Text;
 
 /**
  * Extends the {@link BundleDbPersistenceManager} by MS-SQL specific code.
@@ -33,6 +33,7 @@
  * <li>&lt;param name="{@link #setSchema(String) schema}" value="mssql"/>
  * <li>&lt;param name="{@link #setSchemaObjectPrefix(String) schemaObjectPrefix}"
value=""/>
  * <li>&lt;param name="{@link #setErrorHandling(String) errorHandling}" value=""/>
+ * <li>&lt;param name="{@link #setTableSpace(String) tableSpace}" value=""/>
  * </ul>
  */
 public class MSSqlPersistenceManager extends BundleDbPersistenceManager {
@@ -40,18 +41,39 @@
     /** the cvs/svn id */
     static final String CVS_ID = "$URL$ $Rev$ $Date$";
 
+    /** the MS SQL table space to use */
+    protected String tableSpace = "";
+
+    public MSSqlPersistenceManager() {
+        setDriver("com.microsoft.sqlserver.jdbc.SQLServerDriver");
+        setSchema("mssql");
+    }
+
+    protected String createSchemaSQL(String sql) {
+        return Text.replace(
+                super.createSchemaSQL(sql), "${tableSpace}", tableSpace);
+    }
+
     /**
-     * {@inheritDoc}
+     * Returns the configured MS SQL table space.
+     * 
+     * @return the configured MS SQL table space.
      */
-    public void init(PMContext context) throws Exception {
-        // init default values
-        if (getDriver() == null) {
-            setDriver("com.microsoft.sqlserver.jdbc.SQLServerDriver");
-        }
-        if (getSchema() == null) {
-            setSchema("mssql");
+    public String getTableSpace() {
+        return tableSpace;
+    }
+
+    /**
+     * Sets the MS SQL table space.
+     * 
+     * @param tableSpace the MS SQL table space.
+     */
+    public void setTableSpace(String tableSpace) {
+        if (tableSpace != null && tableSpace.length() > 0) {
+            this.tableSpace = "on " + tableSpace.trim();
+        } else {
+            this.tableSpace = "";
         }
-        super.init(context);
     }
 
 }

Modified: jackrabbit/branches/1.4/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/journal/mssql.ddl
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.4/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/journal/mssql.ddl?rev=610219&r1=610218&r2=610219&view=diff
==============================================================================
--- jackrabbit/branches/1.4/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/journal/mssql.ddl
(original)
+++ jackrabbit/branches/1.4/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/journal/mssql.ddl
Tue Jan  8 15:09:55 2008
@@ -13,10 +13,10 @@
 #  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 IMAGE)
-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}JOURNAL (REVISION_ID BIGINT NOT NULL, JOURNAL_ID varchar(255),
PRODUCER_ID varchar(255), REVISION_DATA IMAGE) ${tableSpace}
+create unique index ${schemaObjectPrefix}JOURNAL_IDX on ${schemaObjectPrefix}JOURNAL (REVISION_ID)
${tableSpace}
+create table ${schemaObjectPrefix}GLOBAL_REVISION (REVISION_ID BIGINT NOT NULL) ${tableSpace}
+create unique index ${schemaObjectPrefix}GLOBAL_REVISION_IDX on ${schemaObjectPrefix}GLOBAL_REVISION
(REVISION_ID) ${tableSpace}
 
 # Inserting the one and only revision counter record now helps avoiding race conditions
 insert into ${schemaObjectPrefix}GLOBAL_REVISION VALUES(0)

Modified: jackrabbit/branches/1.4/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/persistence/bundle/mssql.ddl
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.4/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/persistence/bundle/mssql.ddl?rev=610219&r1=610218&r2=610219&view=diff
==============================================================================
--- jackrabbit/branches/1.4/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/persistence/bundle/mssql.ddl
(original)
+++ jackrabbit/branches/1.4/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/persistence/bundle/mssql.ddl
Tue Jan  8 15:09:55 2008
@@ -1,21 +1,21 @@
-#  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 binary(16) not null, BUNDLE_DATA image
not null)
-create unique index ${schemaObjectPrefix}BUNDLE_IDX on ${schemaObjectPrefix}BUNDLE (NODE_ID)
-create table ${schemaObjectPrefix}REFS (NODE_ID binary(16) not null, REFS_DATA image not
null)
-create unique index ${schemaObjectPrefix}REFS_IDX on ${schemaObjectPrefix}REFS (NODE_ID)
-create table ${schemaObjectPrefix}BINVAL (BINVAL_ID varchar(64) not null, BINVAL_DATA image
not null)
-create unique index ${schemaObjectPrefix}BINVAL_IDX on ${schemaObjectPrefix}BINVAL (BINVAL_ID)
-create table ${schemaObjectPrefix}NAMES (ID INTEGER IDENTITY(1,1) PRIMARY KEY, NAME varchar(255)
COLLATE Latin1_General_CS_AS not null)
\ No newline at end of file
+#  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 binary(16) not null, BUNDLE_DATA image
not null) ${tableSpace}
+create unique index ${schemaObjectPrefix}BUNDLE_IDX on ${schemaObjectPrefix}BUNDLE (NODE_ID)
${tableSpace}
+create table ${schemaObjectPrefix}REFS (NODE_ID binary(16) not null, REFS_DATA image not
null) ${tableSpace}
+create unique index ${schemaObjectPrefix}REFS_IDX on ${schemaObjectPrefix}REFS (NODE_ID)
${tableSpace}
+create table ${schemaObjectPrefix}BINVAL (BINVAL_ID varchar(64) not null, BINVAL_DATA image
not null) ${tableSpace}
+create unique index ${schemaObjectPrefix}BINVAL_IDX on ${schemaObjectPrefix}BINVAL (BINVAL_ID)
${tableSpace}
+create table ${schemaObjectPrefix}NAMES (ID INTEGER IDENTITY(1,1) PRIMARY KEY, NAME varchar(255)
COLLATE Latin1_General_CS_AS not null) ${tableSpace}



Mime
View raw message