zoukankan      html  css  js  c++  java
  • SSM Connection is read-only. Queries leading to data modification are not allowed

    SSM在mybatis执行存储过程时报Connection is read-only. Queries leading to data modification are not allowed

    需要检查applicationContext.xml的配置,看看是不是设置了只读

       <tx:advice transaction-manager="transactionManager" id="adviceId">
            <tx:attributes>
            <!--  其中*为通配符,即代表以find为开头的所有方法,即表示符合此命名规则的方法作为一个事务。 -->
             <!--propagation="REQUIRED"代表支持当前事务,如果当前没有事务,就新建一个事务。这是最常见的选择-->
                <!--propagation="SUPPORTS" 支持当前事务,如果当前没有事务,就以非事务方式执行。 -->
             <!-- isolation DEFAULT:采用数据库默认隔离级别 -->
                <!--read-only   事务是否只读?-->
                <tx:method name="find*" read-only="true"/>
                <tx:method name="select*" read-only="true"/>
                <tx:method name="query*" read-only="false" propagation="REQUIRED" isolation="DEFAULT"/>
                <tx:method name="save*" read-only="false" propagation="REQUIRED"/>
                <tx:method name="update*" read-only="false" propagation="REQUIRED"/>
                <tx:method name="delete*" read-only="false" propagation="REQUIRED"/>
                <tx:method name="insert*" read-only="false" propagation="REQUIRED"/>
            </tx:attributes>
        </tx:advice>
  • 相关阅读:
    。。。
    __new__ 单例
    bokeh
    空间数据可视化
    关系网络图
    Pandas 50题练习
    seaborn
    数据输出及内容美化 简单介绍
    数据分析---项目总结
    数学建模
  • 原文地址:https://www.cnblogs.com/flyxlee/p/14073261.html
Copyright © 2011-2022 走看看