jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r609938 - /jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
Date Tue, 08 Jan 2008 11:34:47 GMT
Author: mreutegg
Date: Tue Jan  8 03:34:38 2008
New Revision: 609938

URL: http://svn.apache.org/viewvc?rev=609938&view=rev
Log:
JCR-1296: Exception may get lost in WorkspaceManager.OperationVisitorImpl.execute()

Modified:
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java?rev=609938&r1=609937&r2=609938&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
Tue Jan  8 03:34:38 2008
@@ -746,6 +746,7 @@
          * Executes the operations on the repository service.
          */
         private void execute(ChangeLog changeLog) throws RepositoryException, ConstraintViolationException,
AccessDeniedException, ItemExistsException, NoSuchNodeTypeException, UnsupportedRepositoryOperationException,
VersionException {
+            RepositoryException ex = null;
             try {
                 ItemState target = changeLog.getTarget();
                 batch = service.createBatch(sessionInfo, target.getId());
@@ -755,12 +756,28 @@
                     log.debug("executing " + op.getName());
                     op.accept(this);
                 }
+            } catch (RepositoryException e) {
+                ex = e;
             } finally {
                 if (batch != null) {
-                    service.submit(batch);
+                    try {
+                        // submit must be called even in case there is an
+                        // exception to give the service a chance to clean
+                        // up the batch
+                        service.submit(batch);
+                    } catch (RepositoryException e) {
+                        if (ex == null) {
+                            ex = e;
+                        } else {
+                            log.warn("Exception submitting batch", e);
+                        }
+                    }
                     // reset batch field
                     batch = null;
                 }
+            }
+            if (ex != null) {
+                throw ex;
             }
         }
 



Mime
View raw message