You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by ss...@apache.org on 2013/09/02 18:35:41 UTC

git commit: the repository test currently does not make any sense and will always fail, so removed for now

Updated Branches:
  refs/heads/develop 472cba26d -> a1fb498e5


the repository test currently does not make any sense and will always fail, so removed for now


Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/a1fb498e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/a1fb498e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/a1fb498e

Branch: refs/heads/develop
Commit: a1fb498e52d611cfc2f7232a9451573bfaf99943
Parents: 472cba2
Author: Sebastian Schaffert <ss...@apache.org>
Authored: Mon Sep 2 18:35:42 2013 +0200
Committer: Sebastian Schaffert <ss...@apache.org>
Committed: Mon Sep 2 18:35:42 2013 +0200

----------------------------------------------------------------------
 .../kiwi/persistence/KiWiConnection.java        | 37 +++++++----
 .../sesame/repository/KiWiRepositoryTest.java   | 69 --------------------
 2 files changed, 26 insertions(+), 80 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/a1fb498e/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiConnection.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiConnection.java b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiConnection.java
index 9aa43e4..48b3c5f 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiConnection.java
+++ b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiConnection.java
@@ -1942,20 +1942,35 @@ public class KiWiConnection {
     public void commit() throws SQLException {
         numberOfCommits++;
 
-        if(persistence.getConfiguration().isCommitSequencesOnCommit() || numberOfCommits % 100 == 0) {
-            commitMemorySequences();
-        }
+        try {
+            if(persistence.getConfiguration().isCommitSequencesOnCommit() || numberOfCommits % 100 == 0) {
+                commitMemorySequences();
+            }
 
 
-        if(tripleBatch != null && tripleBatch.size() > 0) {
-            flushBatch();
-        }
+            if(tripleBatch != null && tripleBatch.size() > 0) {
+                flushBatch();
+            }
 
 
-        deletedStatementsLog.clear();
+            deletedStatementsLog.clear();
 
-        if(connection != null) {
-            connection.commit();
+            if(connection != null) {
+                connection.commit();
+            }
+        } catch(SQLException ex) {
+            if(retry < 10) {
+                log.warn("COMMIT: temporary concurrency conflict, retrying in 1000 ms ... (thread={}, retry={})", Thread.currentThread().getName(), retry);
+                try {
+                    Thread.sleep(1000);
+                } catch (InterruptedException e) {}
+                retry++;
+                flushBatch();
+                retry--;
+            } else {
+                log.error("COMMIT: concurrency conflict could not be solved!");
+                throw ex;
+            }
         }
     }
 
@@ -2132,7 +2147,7 @@ public class KiWiConnection {
             } catch (SQLException ex) {
                 if(retry < 10) {
                     connection.rollback(savepoint);
-                    log.warn("temporary concurrency conflict, retrying in 1000 ms ... (thread={}, retry={})", Thread.currentThread().getName(), retry);
+                    log.warn("BATCH: temporary concurrency conflict, retrying in 1000 ms ... (thread={}, retry={})", Thread.currentThread().getName(), retry);
                     try {
                         Thread.sleep(1000);
                     } catch (InterruptedException e) {}
@@ -2140,7 +2155,7 @@ public class KiWiConnection {
                     flushBatch();
                     retry--;
                 } else {
-                    log.error("concurrency conflict could not be solved!");
+                    log.error("BATCH: concurrency conflict could not be solved!");
 
                     System.err.println("main exception:");
                     ex.printStackTrace();

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/a1fb498e/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/repository/KiWiRepositoryTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/repository/KiWiRepositoryTest.java b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/repository/KiWiRepositoryTest.java
deleted file mode 100644
index 26e3be8..0000000
--- a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/repository/KiWiRepositoryTest.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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.marmotta.kiwi.test.sesame.repository;
-
-import org.apache.marmotta.kiwi.config.KiWiConfiguration;
-import org.apache.marmotta.kiwi.sail.KiWiStore;
-import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
-import org.junit.runner.RunWith;
-import org.openrdf.repository.Repository;
-import org.openrdf.repository.RepositoryTest;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailException;
-import org.openrdf.sail.helpers.SailWrapper;
-
-import java.sql.SQLException;
-
-import static org.junit.Assert.fail;
-
-/**
- * Run the {@link RepositoryTest}s.
- * @author Jakob Frank <ja...@apache.org>
- *
- */
-@RunWith(KiWiDatabaseRunner.class)
-public class KiWiRepositoryTest extends RepositoryTest {
-
-    private final KiWiConfiguration config;
-
-    public KiWiRepositoryTest(KiWiConfiguration config) {
-        this.config = config;
-    }
-
-    /* (non-Javadoc)
-     * @see org.openrdf.repository.RepositoryTest#createRepository()
-     */
-    @Override
-    protected Repository createRepository() throws Exception {
-        Sail store = new SailWrapper(new KiWiStore(config)) {
-            @Override
-            public void shutDown() throws SailException {
-                try {
-                    ((KiWiStore)getBaseSail()).getPersistence().dropDatabase();
-                } catch (SQLException e) {
-                    fail("SQL exception while deleting database");
-                }
-
-                super.shutDown();
-            }
-        };
-        return new SailRepository(store);
-    }
-
-}