jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1325159 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/api/ oak-core/src/main/java/org/apache/jackrabbit/oak/core/ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/
Date Thu, 12 Apr 2012 08:54:30 GMT
Author: mduerig
Date: Thu Apr 12 08:54:30 2012
New Revision: 1325159

URL: http://svn.apache.org/viewvc?rev=1325159&view=rev
Log:
OAK-18: Define Oak API 
don't implicitly refresh connection on commit

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Connection.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ConnectionImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Connection.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Connection.java?rev=1325159&r1=1325158&r2=1325159&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Connection.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Connection.java
Thu Apr 12 08:54:30 2012
@@ -87,14 +87,12 @@ public interface Connection extends Clos
 
     /**
      * Atomically apply all changes in the passed {@code editor} to the underlying
-     * Microkernel. On success this connection is implicitly refreshed to the state
-     * created by applying the editor.
+     * Microkernel.
      *
      * @param editor  editor carrying the changes to be applies
-     * @return  node state resulting from applying the changed
      * @throws CommitFailedException
      */
-    NodeState commit(NodeStateEditor editor) throws CommitFailedException;
+    void commit(NodeStateEditor editor) throws CommitFailedException;
 
     /**
      * Get an node state editor for the given state. Use {@link #commit(NodeStateEditor)}

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ConnectionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ConnectionImpl.java?rev=1325159&r1=1325158&r2=1325159&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ConnectionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ConnectionImpl.java
Thu Apr 12 08:54:30 2012
@@ -104,9 +104,9 @@ public class ConnectionImpl implements C
     }
 
     @Override
-    public NodeState commit(NodeStateEditor editor) throws CommitFailedException {
+    public void commit(NodeStateEditor editor) throws CommitFailedException {
         try {
-            return root = store.merge(editor, editor.getBaseNodeState());
+            store.merge(editor, editor.getBaseNodeState());
         }
         catch (MicroKernelException e) {
             throw new CommitFailedException(e);

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java?rev=1325159&r1=1325158&r2=1325159&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
Thu Apr 12 08:54:30 2012
@@ -19,7 +19,6 @@ package org.apache.jackrabbit.oak.jcr;
 import org.apache.jackrabbit.commons.AbstractSession;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.Connection;
-import org.apache.jackrabbit.oak.api.NodeState;
 import org.apache.jackrabbit.oak.api.NodeStateEditor;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -155,8 +154,9 @@ public class SessionImpl extends Abstrac
     public void save() throws RepositoryException {
         checkIsAlive();
         try {
-            NodeState newState = connection.commit(editor);
-            editor = connection.getNodeStateEditor(newState);
+            connection.commit(editor);
+            connection.refresh();
+            editor = connection.getNodeStateEditor(connection.getCurrentRoot());
             itemStateProvider = new ItemStateProvider(editor.getTransientState());
         } catch (CommitFailedException e) {
             throw new RepositoryException(e);



Mime
View raw message