diff --git a/source/java/org/alfresco/repo/lock/mem/AbstractLockStore.java b/source/java/org/alfresco/repo/lock/mem/AbstractLockStore.java index 97158681d9..95ece667c5 100644 --- a/source/java/org/alfresco/repo/lock/mem/AbstractLockStore.java +++ b/source/java/org/alfresco/repo/lock/mem/AbstractLockStore.java @@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentMap; import org.alfresco.repo.transaction.TransactionalResourceHelper; import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.util.ParameterCheck; import org.springframework.dao.ConcurrencyFailureException; import org.springframework.transaction.support.TransactionSynchronizationManager; @@ -44,6 +45,7 @@ public abstract class AbstractLockStore txMap = getTxMap(); if (txMap != null && txMap.containsKey(nodeRef)) diff --git a/source/test-java/org/alfresco/repo/rendition/RenditionServiceIntegrationTest.java b/source/test-java/org/alfresco/repo/rendition/RenditionServiceIntegrationTest.java index d1faffdcc6..510f065d39 100644 --- a/source/test-java/org/alfresco/repo/rendition/RenditionServiceIntegrationTest.java +++ b/source/test-java/org/alfresco/repo/rendition/RenditionServiceIntegrationTest.java @@ -647,6 +647,11 @@ public class RenditionServiceIntegrationTest extends BaseAlfrescoSpringTest * @throws Exception */ protected void renderPdfDocumentLongRunningTest(AbstractNodeModifyingRunnable nodeModifyingRunnable) throws Exception + { + renderPdfDocumentLongRunningTest(nodeModifyingRunnable, false); + } + + protected void renderPdfDocumentLongRunningTest(AbstractNodeModifyingRunnable nodeModifyingRunnable, boolean joinNodeModifyingThread) throws Exception { this.setComplete(); this.endTransaction(); @@ -697,6 +702,11 @@ public class RenditionServiceIntegrationTest extends BaseAlfrescoSpringTest // Give a moment for roll back of rendition and commit of node modification to occur Thread.sleep(3000); + if (joinNodeModifyingThread) + { + nodeModifyingThread.join(); + } + // Note that the node modification is retried on failure by RetryingTransactionHelper // and will always succeed after the rendition is complete, but due to the // sleep in AbstractNodeModifyingRunnable isModificationUnblocked will still @@ -732,7 +742,7 @@ public class RenditionServiceIntegrationTest extends BaseAlfrescoSpringTest checkOutCheckInService.checkout(nodeWithDocContent); } }; - renderPdfDocumentLongRunningTest(new CheckoutRunnable(nodeWithDocContent)); + renderPdfDocumentLongRunningTest(new CheckoutRunnable(nodeWithDocContent), true); } finally {