mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Hack-fix for Repository start/stop issues
- Nick will investigate further - JBPM is shutting down Hibernate (along with shared resources) in a finalize() git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19135 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -190,6 +190,14 @@ public class InternalEhCacheManagerFactoryBean implements FactoryBean<CacheManag
|
||||
*/
|
||||
public void stop()
|
||||
{
|
||||
// TODO: Does this port over different Locales?
|
||||
// Better to override DbPersistenceServiceFactory#close to put a marker on the thread.
|
||||
if (Thread.currentThread().getName().contains("Finalizer"))
|
||||
{
|
||||
// Probably JBPM's finalizer code ... we rely on Spring context calls rather
|
||||
return;
|
||||
}
|
||||
|
||||
synchronized (getClass())
|
||||
{
|
||||
if(logger.isDebugEnabled()) {
|
||||
@@ -199,8 +207,11 @@ public class InternalEhCacheManagerFactoryBean implements FactoryBean<CacheManag
|
||||
}
|
||||
}
|
||||
|
||||
InternalEhCacheManagerFactoryBean.getInstance().shutdown();
|
||||
initialized = false;
|
||||
if (initialized) // Avoid re-initialization if it has already been shut down
|
||||
{
|
||||
InternalEhCacheManagerFactoryBean.getInstance().shutdown();
|
||||
initialized = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user