Java报错之Connection is read-only.

来源:互联网 发布:java集成开发工具 编辑:程序博客网 时间:2024/05/22 18:22

原因很简单,查看spring的配置,发现有如下标签:

<tx:attributes>
<tx:method name="find*" propagation="REQUIRED" read-only="true" />
<tx:method name="query*" propagation="REQUIRED" read-only="true" />
<tx:method name="list*" propagation="REQUIRED" read-only="true" />
<tx:method name="search*" propagation="REQUIRED" read-only="true" />
<tx:method name="get*" propagation="REQUIRED" read-only="true" />
<tx:method name="save*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="delete*" propagation="REQUIRED" />
<tx:method name="create*" propagation="REQUIRED" />
<tx:method name="*" propagation="SUPPORTS" />
</tx:attributes>


带有read_only 的标签,表示,方法名以find,quey,list,search,get 开头,是只读的。

解决办法就是改方法名

阅读全文
0 0
原创粉丝点击