DataContext child = new DataContext(this, objectStore);
// TODO: This method should be deprecated and child context should be created via
// DI with all proper injection, so won't have to guess how to handle query cache.
if (queryCache != null) {
child.setQueryCache(new NestedQueryCache(queryCache));
}
child.setValidatingObjectsOnCommit(isValidatingObjectsOnCommit());
child.usingSharedSnaphsotCache = isUsingSharedSnapshotCache();
return child;