_modelList = new NSMutableArray(EOModelGroup.defaultGroup().models());
_modelList = new NSMutableArray(group.models());
    public void objectStoreWasAdded(NSNotification aNotification) {        if (!_loadingComplete) {            if (_modelList.count() == 0) {                if (EOModelGroup.defaultGroup() != null && EOModelGroup.defaultGroup().models().count() == 0) {                    throw new RuntimeException("No models found in default group");                }                // internal list empty; drop it and use modelgroup's.                _modelList = new NSMutableArray(EOModelGroup.defaultGroup().models());            }            _loadingComplete = true; // make sure we only do this once.            EOModel currentModel = null;            try {                NSNotificationCenter.defaultCenter().addObserver(this,                                                                 new NSSelector("transactionBeginning", ERXConstant.NotificationClassArray),                                                                 EOAdaptorContext.AdaptorContextBeginTransactionNotification,                                                                 null);                log.debug("Beginning loading of shared EOs");                NSMutableArray loadedModels = new NSMutableArray();                for (Enumeration e = _modelList.objectEnumerator(); e.hasMoreElements();) {                    currentModel = (EOModel)e.nextElement();                    if (!loadedModels.containsObject(currentModel.name())) {                        loadSharedObjectsForModel(currentModel);                        loadedModels.addObject(currentModel.name());                    }                }                NSNotificationCenter.defaultCenter().removeObserver(this, EOAdaptorContext.AdaptorContextBeginTransactionNotification, null);                if (_didChangeDebugSetting) {                    //_currentAdaptor.setDebugEnabled(true);                    _didChangeDebugSetting = false;                }                if (_transCount != 0) {                    // only print this if we loaded something; otherwise                    // the request for the reg. obj. count with start sharing.                    log.debug("Shared EO loading complete: " + _transCount + " transactions/ " +                              EOSharedEditingContext.defaultSharedEditingContext().registeredObjects().count() + " objects.");                } else {                    log.debug("Shared EO loading complete: no objects loaded.");                }            } catch (Exception e) {                log.error("Exception occurred with model: " + currentModel.name() + "\n" + e + ERXUtilities.stackTrace());                // no matter what happens, un-register for notifications.                NSNotificationCenter.defaultCenter().removeObserver(this, EOAdaptorContext.AdaptorContextBeginTransactionNotification, null);                if (_didChangeDebugSetting) {                    //_currentAdaptor.setDebugEnabled(true);                    _didChangeDebugSetting = false;                }            }        }    }