jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r632376 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core: ItemImpl.java state/ItemState.java
Date Fri, 29 Feb 2008 16:36:45 GMT
Author: stefan
Date: Fri Feb 29 08:36:30 2008
New Revision: 632376

URL: http://svn.apache.org/viewvc?rev=632376&view=rev
Log:
JCR-1359: Adding nodes from concurrently running sessions cause exceptions

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemState.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemImpl.java?rev=632376&r1=632375&r2=632376&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemImpl.java
Fri Feb 29 08:36:30 2008
@@ -1172,11 +1172,17 @@
                     while (depIt.hasNext()) {
                         NodeId id = (NodeId) depIt.next();
                         if (!affectedIds.contains(id)) {
-                            // need to save dependency as well
-                            String msg = itemMgr.safeGetJCRPath(id)
-                                    + " needs to be saved as well.";
-                            log.debug(msg);
-                            throw new ConstraintViolationException(msg);
+                            // JCR-1359 workaround: check whether unresolved
+                            // dependencies originate from 'this' session;
+                            // otherwise ignore them
+                            if (stateMgr.hasTransientItemState(id)
+                                    || stateMgr.hasTransientItemStateInAttic(id)) {
+                                // need to save dependency as well
+                                String msg = itemMgr.safeGetJCRPath(id)
+                                        + " needs to be saved as well.";
+                                log.debug(msg);
+                                throw new ConstraintViolationException(msg);
+                            }
                         }
                     }
                 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemState.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemState.java?rev=632376&r1=632375&r2=632376&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemState.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemState.java
Fri Feb 29 08:36:30 2008
@@ -157,7 +157,7 @@
     /**
      * Pull state information from overlayed state.
      */
-    void pull() {
+    synchronized void pull() {
         ItemState state = overlayedState;
         if (state != null) {
             // sync modification count



Mime
View raw message