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

97181: Merged 5.0.N (5.0.2) to HEAD-BUG-FIX (5.1/Cloud)
      97111: Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.2)
         97019: Merged V4.2.0 (4.2.0.11) to V4.2-BUG-FIX (4.2.5)
            92266: MNT-12936: Temporary GenericCertificateIntegrityException causes repo to go into readOnly
             - Retry transaction if got GenericCertificateIntegrityException 
            92373: MNT-12936: Temporary GenericCertificateIntegrityException causes repo to go into readOnly
             - Remove stale try{}catch{}, modify unit test.
            92842: MNT-12936: Temporary GenericCertificateIntegrityException causes repo to go into readOnly
             - Use exception from repo for retrying
            92899: MNT-12936: Temporary GenericCertificateIntegrityException causes repo to go into readOnly
             - Fix unit test failing: use new exception that was introduced in original fix 


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@97196 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tatyana Valkevych 2015-02-17 10:02:44 +00:00
parent 41446700c7
commit 5d45c38a06
2 changed files with 41 additions and 0 deletions

View File

@ -40,6 +40,7 @@ import org.alfresco.error.ExceptionStackUtil;
import org.alfresco.repo.security.permissions.AccessDeniedException;
import org.alfresco.repo.transaction.AlfrescoTransactionSupport.TxnReadState;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.service.license.LicenseIntegrityException;
import org.alfresco.util.LockHelper.LockTryException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@ -59,6 +60,7 @@ import org.springframework.dao.DeadlockLoserDataAccessException;
import org.springframework.jdbc.JdbcUpdateAffectedIncorrectNumberOfRowsException;
import org.springframework.jdbc.UncategorizedSQLException;
/**
* A helper that runs a unit of work inside a UserTransaction,
* transparently retrying the unit of work if the cause of
@ -104,6 +106,7 @@ public class RetryingTransactionHelper
SQLException.class,
BatchUpdateException.class,
DataIntegrityViolationException.class,
LicenseIntegrityException.class,
StaleStateException.class,
TooManyResultsException.class, // Expected one result but found multiple (bad key alert)
ObjectNotFoundException.class,

View File

@ -0,0 +1,38 @@
/*
* Copyright (C) 2005-2015 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.service.license;
/**
* An instance of this class is thrown if the integrity of a GenericCertificate has been detected to be compromised.
*/
public class LicenseIntegrityException extends Exception
{
private static final long serialVersionUID = 112424979852827947L;
public LicenseIntegrityException(String msg)
{
super(msg);
}
public LicenseIntegrityException(String msg, Throwable cause)
{
super(msg, cause);
}
}