log.trace("Initializing new persistence context for entity {}", entity);
return contextFactory.newContextWithFlushContext(entity, options, flushContext).getPersistenceManagerFacade();
}
protected Options adaptOptionsForBatch(Options options) {
Options modifiedOptions = maybeAddTimestampToStatement(options);
if (!optionsValidator.isOptionsValidForBatch(modifiedOptions)) {
flushContext = flushContext.duplicateWithNoData(defaultConsistencyLevel);
throw new AchillesException("Runtime custom Consistency Level and/or async listeners cannot be set for batch mode. Please set the Consistency Levels at batch start with 'startBatch(consistencyLevel)' and async listener using endBatch(...)");
}
return modifiedOptions;