您的位置:首页 > 编程语言 > Java开发

使用springside遇到Write operations are not allowed in read-only mode

2009-11-13 13:58 423 查看
使用springside写了一个数据库的CRUD,结果在保存对象的时候发现出了这个错误。

仔细查看了spring的applicationContext.xml发现,原来

<!-- 使用annotation定义事务 -->
<tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true" />

是来是用annotation定义的事务

在service类前面加上@Transactional就可以了,否则默认的是readonly

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐