From 968933de3727a54398736bce60f23dfcd64b25bb Mon Sep 17 00:00:00 2001 From: Mark Rogers Date: Fri, 15 Oct 2010 08:41:09 +0000 Subject: [PATCH] Bug fix for case where commit failed. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@23127 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../repo/transfer/TransferServiceImpl2.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source/java/org/alfresco/repo/transfer/TransferServiceImpl2.java b/source/java/org/alfresco/repo/transfer/TransferServiceImpl2.java index 899250a8fd..eaf26632da 100644 --- a/source/java/org/alfresco/repo/transfer/TransferServiceImpl2.java +++ b/source/java/org/alfresco/repo/transfer/TransferServiceImpl2.java @@ -631,8 +631,10 @@ public class TransferServiceImpl2 implements TransferService2 case Commit: { + logger.debug("about to start committing transferId:" + transfer.getTransferId()); eventProcessor.commit(); transmitter.commit(transfer); + logger.debug("committing transferId:" + transfer.getTransferId()); checkCancel(transfer.getTransferId()); @@ -828,9 +830,17 @@ public class TransferServiceImpl2 implements TransferService2 catch(Exception e) { logger.debug("Exception - unable to transfer", e); - failureException = e; - if (transfer != null && (clientState == ClientTransferState.Begin || clientState == ClientTransferState.Prepare)) + /** + * Save the first exception that we encounter. + */ + if(failureException == null) + { + failureException = e; + } + if (transfer != null && (clientState == ClientTransferState.Begin || + clientState == ClientTransferState.Prepare || + clientState == ClientTransferState.Commit)) { // we must first inform the target repository that a client failure has occurred to allow it to // clean up appropriately, too