Merged BRANCHES/DEV/mward/clustering_p1 to HEAD:

41454: ALF-15881: Disabling clustering in community
   41500: ALF-15883: Move configuration files
   41503: ALF-15884: Move cluster package to enterprise repository project
   41504: ALF-15884: Move cluster package to enterprise repository project
   41519: ALF-15886: References/definition for "hazelcastInstanceFactory" must be in enterprise repo only
   41523: ALF-15886: References/definition for "hazelcastInstanceFactory" must be in enterprise repo only
   41525: ALF-15886: References/definition for "hazelcastInstanceFactory" must be in enterprise repo only
   41527: ALF-15886: References/definition for "hazelcastInstanceFactory" must be in enterprise repo only
   41530: ALF-15886: remove import for class no longer in project.
   41532: ALF-15887: LockStoreFactoryImpl must be separated into community and enterprise versions
   41535: ALF-15883: Move configuration files
   41561: ALF-15886: factory class to create key fileserver config beans.
   41578: ALF-15888: separate transactional and shared cache bean definitions.
   41623: ALF-15888: first pass at DefaultSimpleCache implementation.
   41646: ALF-15888: move ehcache-default.xml
   41651: ALF-15888: update javadoc to reflect changes
   41762: ALF-15888: improve cache test to prove that null values are stored correctly.
   41812: ALF-15888: added new cache provider for use by hibernate: DefaultCacheProvider.
   41830: ALF-15888: make DefaultSimpleCache BeanNameAware to help with debugging etc.
   41831: ALF-15888: missing file from commit - adds enterprise override capability for hibernate-cfg.properties
   41850: ALF-15888: move tickets cache to cache-context.xml
   41857: ALF-15888: make RemoteAlfrescoTicketServiceImpl cache implementation agnostic.
   41866: ALF-15888: extract caches from fileservers and web-client and provide enterprise overrides
   41881: ALF-15888: replace use of EhCacheAdapter with DefaultSimpleCache and SimpleCache interface.
   41884: ALF-15888: added DefaultSimpleCache configuration to CachingContentStore sample XML.
   41885: ALF-15888: move EhCacheAdapter to new package.
   41886: ALF-15888: correct absolute class names in config for EhCacheAdapter.
   41892: ALF-15888: fix CachingContentStore tests.
   41897: ALF-15888: move CacheTest and config to new package.
   41898: ALF-15888: remove redundant directory
   41899: ALF-15889: move EhCacheManagerFactoryBean to new package.
   41902: ALF-15889: moved EhCacheTracerJob to new package.
   41913: ALF-15889: move InternalEhCacheManagerFactoryBean to new package.
   41916: ALF-15889: move AlfrescoCacheManagerPeerProviderFactory to new package.
   41937: ALF-15889: decouple TransactionalCache from EhCache
   41966: ALF-15889: decouple RetryingTransactionHelper from ehcache.
   41989: ALF-15889: added ContextListener test.
   41996: ALF-15889: moved cache test to its own class.
   41998: ALF-15889: move ehcache jars.
   41999: ALF-15889: modify .classpath to reflect jar moves.
   42037: ALF-15889: update poms to reflect lib moves.
   42038: ALF-15889: add eclipse library reference to enterprise projects.
   42093: ALF-15916: moved core properties to enterprise
   42114: ALF-15888: externalized cache sizes to repository.properties.
   42127: ALF-16136: move re-indexing configuration
   42140: ALF-16136: move cluster check property.
   42186: ALF-15889: removing seemingly redundant test config file.
   42187: ALF-15888: tidy up config changes.
   42189: ALF-15888: cleanup config
   42190: ALF-15888: config cleanup
   42191: ALF-15888: config cleanup
   42198: ALF-16136: restored lost property



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@42210 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Matt Ward
2012-10-01 12:17:53 +00:00
parent 131080b564
commit 511af90d5c
79 changed files with 1471 additions and 7954 deletions

View File

@@ -21,6 +21,9 @@ package org.alfresco.repo.transaction;
import java.lang.reflect.Method;
import java.sql.BatchUpdateException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Random;
@@ -31,8 +34,6 @@ import javax.transaction.RollbackException;
import javax.transaction.Status;
import javax.transaction.UserTransaction;
import net.sf.ehcache.distribution.RemoteCacheException;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.error.ExceptionStackUtil;
import org.alfresco.repo.security.permissions.AccessDeniedException;
@@ -89,24 +90,68 @@ public class RetryingTransactionHelper
public static final Class[] RETRY_EXCEPTIONS;
static
{
RETRY_EXCEPTIONS = new Class[] {
ConcurrencyFailureException.class,
DeadlockLoserDataAccessException.class,
StaleObjectStateException.class,
JdbcUpdateAffectedIncorrectNumberOfRowsException.class, // Similar to StaleObjectState
LockAcquisitionException.class,
ConstraintViolationException.class,
UncategorizedSQLException.class,
SQLException.class,
BatchUpdateException.class,
DataIntegrityViolationException.class,
StaleStateException.class,
TooManyResultsException.class, // Expected one result but found multiple (bad key alert)
ObjectNotFoundException.class,
CacheException.class, // Usually a cache replication issue
RemoteCacheException.class, // A cache replication issue
SQLGrammarException.class // Actually specific to MS SQL Server 2005 - we check for this
};
Class<?>[] coreClasses = new Class[] {
ConcurrencyFailureException.class,
DeadlockLoserDataAccessException.class,
StaleObjectStateException.class,
JdbcUpdateAffectedIncorrectNumberOfRowsException.class, // Similar to StaleObjectState
LockAcquisitionException.class,
ConstraintViolationException.class,
UncategorizedSQLException.class,
SQLException.class,
BatchUpdateException.class,
DataIntegrityViolationException.class,
StaleStateException.class,
TooManyResultsException.class, // Expected one result but found multiple (bad key alert)
ObjectNotFoundException.class,
CacheException.class, // Usually a cache replication issue
SQLGrammarException.class // Actually specific to MS SQL Server 2005 - we check for this
};
List<Class<?>> retryExceptions = new ArrayList<Class<?>>();
// Add core classes to the list.
retryExceptions.addAll(Arrays.asList(coreClasses));
// Add enterprise-specific classes to the list
retryExceptions.addAll(enterpriseRetryExceptions());
RETRY_EXCEPTIONS = retryExceptions.toArray(new Class[] {});
}
/**
* Use reflection to load a list of enterprise-specific exception classes to add to the
* core list specified in this class.
* <p>
* This is used to decouple this class from enterprise-specific libraries.
*
* @return List of enterprise exception classes or empty list if not available.
*/
private static List<Class<?>> enterpriseRetryExceptions()
{
List<Class<?>> retryExceptions = null;
try
{
Class<?> c = Class.forName("org.alfresco.enterprise.repo.transaction.RetryExceptions");
retryExceptions = (List<Class<?>>) c.newInstance();
}
catch (ClassNotFoundException error)
{
// It's ok not to have the enterprise class available.
}
catch (InstantiationException error)
{
throw new AlfrescoRuntimeException("Unable to instantiate enterprise RetryExceptions.");
}
catch (IllegalAccessException error)
{
throw new AlfrescoRuntimeException("Unable to instantiate enterprise RetryExceptions.");
}
// If no enterprise class found then create an empty list.
if (retryExceptions == null)
{
retryExceptions = Collections.emptyList();
}
return retryExceptions;
}
/**