// check uniqueness constraints when leaving the root
if (keysToCheckForUniqueness != null
&& !keysToCheckForUniqueness.isEmpty()) {
NodeState indexMeta = definition.getNodeState();
IndexStoreStrategy s = getStrategy(true);
for (String key : keysToCheckForUniqueness) {
if (s.count(indexMeta, singleton(key), 2) > 1) {
String msg = String.format("Uniqueness constraint violated at path [%s] for one of the " +
"property in %s having value %s", getPath(), propertyNames, key);
throw new CommitFailedException(
CONSTRAINT, 30, msg);
}