incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r900798 - /sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/DynamicClassLoaderProviderImpl.java
Date Tue, 19 Jan 2010 14:35:40 GMT
Author: cziegeler
Date: Tue Jan 19 14:35:40 2010
New Revision: 900798

URL: http://svn.apache.org/viewvc?rev=900798&view=rev
Log:
SLING-1296 : Potential concurrent modification exception during path creation

Modified:
    sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/DynamicClassLoaderProviderImpl.java

Modified: sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/DynamicClassLoaderProviderImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/DynamicClassLoaderProviderImpl.java?rev=900798&r1=900797&r2=900798&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/DynamicClassLoaderProviderImpl.java
(original)
+++ sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/DynamicClassLoaderProviderImpl.java
Tue Jan 19 14:35:40 2010
@@ -212,12 +212,19 @@
                     if (parentNode == null) {
                         parentNode = current;
                     }
-                    current = current.addNode(names[i], "nt:folder");
+                    try {
+                        current.addNode(names[i], "nt:folder");
+                        session.save();
+                    } catch (RepositoryException re) {
+                        // we ignore this as this might be a concurrent modification!
+                        session.refresh(false);
+                    }
+                    current = current.getNode(names[i]);
                 }
             }
 
             if (parentNode != null) {
-                parentNode.save();
+                session.save();
                 return true;
             }
 



Mime
View raw message