Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)

69949: Merged V4.2-BUG-FIX (4.2.3) to HEAD-BUG-FIX (4.3/Cloud)
      69867: Fix handling of non-propagating transactions embedded in write transactions that have been forced writable (MNT-11310)
       - Test to demonstrate the failure
       - Regardless of whether a RetryingTransactionHelper was going to create a new transaction (non-propagating) or not,
         it did a sanity check of its read-write state against the desired state.  This was kicking things out for cases
         where the RetryingTransactionInterceptor should just have been going along with the current transaction.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@70465 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2014-05-16 20:09:47 +00:00
parent 81d2356496
commit 5763abbf6d
2 changed files with 82 additions and 5 deletions

View File

@@ -360,11 +360,6 @@ public class RetryingTransactionHelper
*/
public <R> R doInTransaction(RetryingTransactionCallback<R> cb, boolean readOnly, boolean requiresNew)
{
if (this.readOnly && !readOnly)
{
throw new AccessDeniedException(MSG_READ_ONLY);
}
// First validate the requiresNew setting
if (!requiresNew)
{
@@ -390,6 +385,15 @@ public class RetryingTransactionHelper
throw new RuntimeException("Unknown transaction state: " + readState);
}
}
// If we need a new transaction, then we have to check that the read-write request can be served
if (requiresNew)
{
if (this.readOnly && !readOnly)
{
throw new AccessDeniedException(MSG_READ_ONLY);
}
}
// If we are time limiting, set ourselves a time limit and maintain the count of concurrent transactions
long startTime = 0;