在学习ssh整合的时候,报错Write operations are not allowed in read-only mode (FlushMode.MANUAL) :
Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.
protected void checkWriteOperationAllowed(Session session) throws InvalidDataAccessApiUsageException {
if (isCheckWriteOperations() && session.getFlushMode().lessThan(FlushMode.COMMIT)) {
throw new InvalidDataAccessApiUsageException(
"Write operations are not allowed in read-only mode (FlushMode.MANUAL): "+
"Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.");
}
}
这个FlushMode为什么会默认是MANUAL,怎么修改呢?
younghu
相关分类