final ODistributedConfiguration cfg = getDatabaseConfiguration(iDatabase.getName());
if (cfg == null)
return;
if (iDatabase instanceof ODatabaseComplex<?> && !(iDatabase.getStorage() instanceof ODistributedStorage)) {
ODistributedStorage storage = storages.get(iDatabase.getURL());
if (storage == null) {
storage = new ODistributedStorage(serverInstance, (OStorageEmbedded) iDatabase.getStorage());
final ODistributedStorage oldStorage = storages.putIfAbsent(iDatabase.getURL(), storage);
if (oldStorage != null)
storage = oldStorage;
}
iDatabase.replaceStorage(storage);