From fa4940d0780544dfec78745b74b642a0be77b104 Mon Sep 17 00:00:00 2001 From: Jan Vonka Date: Wed, 4 Aug 2010 15:33:28 +0000 Subject: [PATCH] ALF-4227 - MSSQLServer: fix hang on RetryingTransactionHelperTest (no lock wait timeout) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@21608 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../transaction/RetryingTransactionHelperTest.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/source/java/org/alfresco/repo/transaction/RetryingTransactionHelperTest.java b/source/java/org/alfresco/repo/transaction/RetryingTransactionHelperTest.java index ebabe3e8bd..e313df2cd1 100644 --- a/source/java/org/alfresco/repo/transaction/RetryingTransactionHelperTest.java +++ b/source/java/org/alfresco/repo/transaction/RetryingTransactionHelperTest.java @@ -27,6 +27,7 @@ import junit.framework.TestCase; import org.alfresco.error.ExceptionStackUtil; import org.alfresco.model.ContentModel; +import org.alfresco.repo.domain.hibernate.dialect.AlfrescoSQLServerDialect; import org.alfresco.repo.security.authentication.AuthenticationComponent; import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.transaction.AlfrescoTransactionSupport.TxnReadState; @@ -374,17 +375,20 @@ public class RetryingTransactionHelperTest extends TestCase * Checks nesting of two transactions with requiresNew == true, * but where the two transactions get involved in a concurrency struggle. * - * Note: skip test for PostgreSQL + * Note: skip test for PostgreSQL and MS SQL Server */ - public void testNestedWithoutPropogationConcurrentUntilFailureNotPostgreSQL() throws InterruptedException + public void testNestedWithoutPropogationConcurrentUntilFailureNotPostgreSQLOrMSSQL() throws InterruptedException { final RetryingTransactionHelper txnHelperForTest = transactionService.getRetryingTransactionHelper(); txnHelperForTest.setMaxRetries(1); - if (dialect instanceof PostgreSQLDialect) + if ((dialect instanceof PostgreSQLDialect) || (dialect instanceof AlfrescoSQLServerDialect)) { - // NOOP - skip test for PostgreSQL since it does not support lock wait timeout hence will hang if concurrently "nested" (in terms of Spring) since the initial transaction does not complete + // NOOP + // skip test for PostgreSQL and MS SQL Server to avoid hang if concurrently "nested" (in terms of Spring) since the initial transaction does not complete // see testConcurrencyRetryingNoFailure instead + // Note: PostgreSQL does not support lock timeout + // Note: MS SQL Server does not support lock wait timeout by default (will wait forever) unless it is overridden on each connection ("set lock_timout") } else {