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:
Derek Hulley
2010-03-09 00:47:59 +00:00
parent 7e837dcc74
commit ccd0614e8a
2 changed files with 17 additions and 6 deletions

View File

@@ -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;
}
}
}