From: Adam R. <ad...@ex...> - 2014-10-24 21:16:41
|
So I have noticed that when creating a new Collection in eXist the collection is being configured twice, which to me looks totally unnecessary. I think we have a bug! Looking at HEAD of the develop branch, the call chain looks like this - 1) NativeBroker#getOrCreateCollection, line 702: collectionConfigurationManager.addConfiguration(transaction, this, current, initCollectionConfig); 2) CollectionConfigurationManager#addConfiguration, line 130: confCol.store(txn, broker, info, config, false); 3) Collection#storeXMLInternal, lines 1409 and 1410: manager.invalidate(getURI(), broker.getBrokerPool()); manager.loadConfiguration(broker, this); 4) CollectionConfigurationManager#addConfiguration, lines 137 and 138: configurations.remove(new CollectionURI(path.getRawCollectionPath())); loadConfiguration(broker, confCol); So you can see that the Configuration is invalidated and re-loaded first in frame (3) and then again in frame (4). As far as I can see, we only need to do this once. The code in frame (4) I *think* was added more recently by Dmitriy but seems unnecessary as this is already done by the more general function in (3). I propose to remove the redundant code in (4). Have I missed anything obvious? Am I being stupid? ...and if not, any objections to me removing the extraneous code? Thanks Adam. -- Adam Retter eXist Developer { United Kingdom } ad...@ex... irc://irc.freenode.net/existdb |