org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read

使用SSH框架做保存操作时,忘记加事务,报了以下错误:
org.springframework.dao.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.
org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read
加入事务注解,问题解决:
org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read