美文网首页我爱编程
java.sql.SQLException: Connectio

java.sql.SQLException: Connectio

作者: ggr | 来源:发表于2018-04-11 23:25 被阅读0次

    项目调试的时候出现一个bug,在测试一个叫做forbidCustomerById的时候,出现了这个bug,很奇怪。
    原来spring是我spring配置里面有这个

    <tx:advice id="txAdvice" transaction-manager="transactionManager">
            <tx:attributes>
                <tx:method name="publish*" />
                <tx:method name="save*" />
                <tx:method name="add*" />
                <tx:method name="update*" />
                <tx:method name="insert*" />
                <tx:method name="create*" />
                <tx:method name="del*" />
                <tx:method name="load*" />
                <tx:method name="init*" />
                <tx:method name="*"  read-only="true"/>
            </tx:attributes>
        </tx:advice>
    

    这个方法匹配到了*,所以才导致的操作只读,然后后台报错!
    这个配置也是网上down的,之前大致瞄了一下,现在想想还是当时太懒了。没仔细审查一下网上的东西是不是和我们本地项目切合。

    相关文章

      网友评论

        本文标题:java.sql.SQLException: Connectio

        本文链接:https://www.haomeiwen.com/subject/kxstkftx.html