Write operations are not allowed in read-only mode (FlushMode.MANUAL)
2014-06-17 13:23
417 查看
Hibernate使用过程中出现此类错误:Write operations are not allowed in read-only mode (FlushMode.MANUAL)
解决办法:
检查你的事务配置中的方法前缀是否和你现在使用的方法前缀一致,如果一致,需要修改你使用的方法前缀。
例如:
事务配置:
<tx:attributes>
<tx:method name="insert*" rollback-for="Exception" />
<tx:method name="update*" rollback-for="Exception" />
<tx:method name="delete*" rollback-for="Exception" />
<tx:method name="get*" read-only="true" />
<tx:method name="*" />
</tx:attributes>
方法:getProductPackId 建议修改前缀xxxProductPackId 主要是看你的事务配置哪一层了
解决办法:
检查你的事务配置中的方法前缀是否和你现在使用的方法前缀一致,如果一致,需要修改你使用的方法前缀。
例如:
事务配置:
<tx:attributes>
<tx:method name="insert*" rollback-for="Exception" />
<tx:method name="update*" rollback-for="Exception" />
<tx:method name="delete*" rollback-for="Exception" />
<tx:method name="get*" read-only="true" />
<tx:method name="*" />
</tx:attributes>
方法:getProductPackId 建议修改前缀xxxProductPackId 主要是看你的事务配置哪一层了
相关文章推荐
- Write operations are not allowed in read-only mode (FlushMode.MANUAL):
- Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushM
- Write operations are not allowed in read-only mode (FlushMode.MANUAL): 解决方法
- Write operations are not allowed in read-only mode (FlushMode.MANUAL)错误的解决方法
- Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn
- Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushM
- Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushM
- Write operations are not allowed in read-only mode (FlushMode.MANUAL)错误解决
- Write operations are not allowed in read-only mode (FlushMode.MANUAL):
- 解决Spring4+Hibernate4遇到的 Write operations are not allowed in read-only mode (FlushMode.MANUAL)
- 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' mar
- 解决:Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into Flu
- Write operations are not allowed in read-only mode (FlushMode.MANUAL)错误解决的一种方法
- Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn
- Spring整合Hibernate错误日记2:Write operations are not allowed in read-only mode (FlushMode.MANUAL)
- HTTP Status 500 - Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your S
- 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.
- HTTP Status 500 - Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your S
- Write operations arenotallowed in read-only mode(FlushMode.MANUAl):
- write operations are not allowed in read-only mode(flushMode.MANUAL)