From 5d45c38a06b1eb3669e33dadbfc6263a21ac096a Mon Sep 17 00:00:00 2001 From: Tatyana Valkevych Date: Tue, 17 Feb 2015 10:02:44 +0000 Subject: [PATCH] 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 --- .../RetryingTransactionHelper.java | 3 ++ .../license/LicenseIntegrityException.java | 38 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100755 source/java/org/alfresco/service/license/LicenseIntegrityException.java diff --git a/source/java/org/alfresco/repo/transaction/RetryingTransactionHelper.java b/source/java/org/alfresco/repo/transaction/RetryingTransactionHelper.java index 9384e06b31..62dd5fdc35 100644 --- a/source/java/org/alfresco/repo/transaction/RetryingTransactionHelper.java +++ b/source/java/org/alfresco/repo/transaction/RetryingTransactionHelper.java @@ -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, diff --git a/source/java/org/alfresco/service/license/LicenseIntegrityException.java b/source/java/org/alfresco/service/license/LicenseIntegrityException.java new file mode 100755 index 0000000000..76d902ed1a --- /dev/null +++ b/source/java/org/alfresco/service/license/LicenseIntegrityException.java @@ -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 . + */ +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); + } +}