protected ObjectContext createdFromDataDomain(DataDomain parent) {
// for new dataRowStores use the same name for all stores
// it makes it easier to track the event subject
DataRowStore snapshotCache = (parent.isSharedCacheEnabled()) ? parent
.getSharedSnapshotCache() : new DataRowStore(parent.getName(), parent
.getProperties(), eventManager);
DataContext context = new DataContext(parent, new ObjectStore(snapshotCache));
context.setValidatingObjectsOnCommit(parent.isValidatingObjectsOnCommit());
context.setQueryCache(injector.getInstance(Key.get(