Merged 5.0.N (5.0.3) to HEAD (5.1)

109729: Merged 5.0.2 (5.0.2) to 5.0.N (5.0.3)
      109705: MNT-14463: Deadlock during startup
      DictionaryDAO: Remove side-effect code in:
       - DictionaryRepositoryBootstrap.register: Now it only registers listeners rathern than destroying and rebuilding the dictionary
       - DictionaryDAOImpl.removeDictionaryRegistry: Now it only removes the dictionary rather than removes and reinitialized
      DictionaryRepositoryBootstrap.onBootstrap:
       - RESETS the dictionary (destroy, reinitialize)
       - Then registers listeners
       - Then fires application events
      The stacks and logs for the deadlock show that the dictioanary bootstrap was triggering a background reload
      and then firing the application events without checking that the dictionary had loaded.  The events will now
      only be fired once the dictionary has successfully retrieved an instance i.e. no other code will need to wait
      for the background thread after the reset has finished.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@109804 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-08-08 08:01:06 +00:00
parent 42c5ebba5b
commit f7e3dc7e6c

View File

@@ -624,7 +624,13 @@ implements TenantDeployer, DictionaryListener, /*TenantDictionaryListener, */Mes
@Override
protected void onBootstrap(ApplicationEvent event)
{
// Reset the dictionary (destroy and reload)
dictionaryDAO.reset();
// Register listeners
register();
// The listeners can now know about this
((ApplicationContext) event.getSource()).publishEvent(new DictionaryRepositoryBootstrappedEvent(this));
}
@@ -645,13 +651,10 @@ implements TenantDeployer, DictionaryListener, /*TenantDictionaryListener, */Mes
}
/**
* Register
* Register listeners
*/
public void register()
{
// deployer - force reload on next get (eg. bootstrap "rmc:rmcustom")
dictionaryDAO.destroy();
// register with Dictionary Service to allow (re-)init
dictionaryDAO.registerListener(this);