`
waw
  • 浏览: 23004 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论

Connection is read-only. Queries leading to data modification are not allowed

阅读更多

Connection is read-only. Queries leading to data modification are not allowed

 

1.检查事务配置

2.检查方法命名

 

检查在诸如 loadXXXX, queryXXX 的查询方法中,是否用了update,insert ,delete 数据的操作!

 

我的出错的地方是 方法名是 :loadXXXOrAddXXX()

 

事务配置xml如下

 

<tx:advice id="txAdvice" transaction-manager="transactionManager">
        <tx:attributes>
            <tx:method name="load*" read-only="true" />
            <tx:method name="find*" read-only="true" />
            <tx:method name="query*" read-only="true" />
            <tx:method name="select*" read-only="true" />
            <tx:method name="validate*" read-only="true" />
           
            <tx:method name="add*" propagation="REQUIRED"/>
            <tx:method name="insert*" propagation="REQUIRED"/>
            <tx:method name="create*" propagation="REQUIRED"/>
            <tx:method name="save*" propagation="REQUIRED"/>
            <tx:method name="update*" propagation="REQUIRED"/>
            <tx:method name="modify*" propagation="REQUIRED"/>
            <tx:method name="delete*" propagation="REQUIRED"/>
            <tx:method name="remove*" propagation="REQUIRED"/>
            <tx:method name="do*" propagation="REQUIRED"/>
            
            <tx:method name="*" propagation="SUPPORTS"
                rollback-for="Throwable" />
        </tx:attributes>
    </tx:advice>

 

 

就是这个 <tx:method name="load*" read-only="true" /> 
 匹配了

loadXXXOrAddXXX() 这个方法名,然后connection是 readonly的,所以无法做insert的操作!

 

坑爹了!!!!

 

 

 

 

 

 

分享到:
评论

相关推荐

    hibernate-shards.jar

    of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence ...

    wxPython2.8-win32-unicode-2.8.12.1-py27.exe

    wxPython is a GUI toolkit for the Python programming language. It allows Python ...Since the language is Python, wxPython programs are simple, easy to write and easy to understand. Here is an example.

    CX-One Introduction guide

    1. What is CX-One? 2. Features of CX-One 3. Integrated Simulation – New Function in Version 2.0 4. CX-One Component Checklist 5. CX-One Installation Procedure Chapter 2 Example of PLC System ...

    最新的xwork-core-2.3.7.jar

    * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the ...

    scribe-2.1.tar.gz

    Scribe is a server for aggregating log data streamed in real ... It is designed to be scalable, extensible without client-side modification, and robust to failure of the network or any specific machine.

    gerrit-3.0.3.war

    Issue 11205: Allow Gerrit admins to reindex a change even when Read access is not allowed on its target branch. Extend the addMenuLink method in the PolyGerrit plugin API to allow plugins to specify ...

    hadoop-eclipse-plugin-2.7.3.jar

    Compiled from hadoop2x-eclipse-plugin with some modification. Ant version: 1.9.7. Hadoop version: 2.7.3. Tested on Eclipse Neon.1 Release(4.6.1)

    NIST SP800-52.pdf

    A message integrity service provides confirmation that data modification is always detected thus preventing undetected deletion, addition, or modification of data. An authentication service provides ...

    The Objective-C Programming Language-2006.pdf

    faster to develop, more amenable to modification, and easier to understand. Most object-oriented development environments consist of at least three parts: ■ A library of objects ■ A ...

    scribe-2.2.tar.gz

    scribe-2.2.tar.gz 下载地址: ... Scribe is a server for ... It is designed to be scalable, extensible without client-side modification, and robust to failure of the network or any specific machine.

    Senfore_DragDrop_v4.1

    IDataObject.GetData to be called before IDropTarget.Drop is called. ------------------------------------------- 5. Support and feedback: ------------------------------------------- Since these ...

    McGraw.Hill - Hacking.Linux.exposed

    and denial of service, modification of data and systems, and even extortion and hoaxes. Perhaps most tragically, they have undermined many users' enjoyment and confidence as they engage in computing...

    ITUG729源代码

    The changes from Version 1.3 to Version 1.4 do not affect the test vectors. ---------------------------------------------------------------------------- DESCRIPTION ----------- This package ...

    NIST SP800-21.pdf

    Cryptography should be considered for data that is sensitive, has a high value, or is vulnerable to unauthorized disclosure or undetected modification during transmission or while in storage1....

    scribe-version-2.01.tar.gz

    Scribe is a server for aggregating log data streamed in real ... It is designed to be scalable, extensible without client-side modification, and robust to failure of the network or any specific machine.

    Iptables 中文指南

    1. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 2. How to Apply These Terms to Your New Programs I. 示例脚本的代码 I.1. rc.firewall脚本代码 I.2. rc.DMZ.firewall脚本代码 I.3. rc....

    unigui0.83.5.820

    - 0000703: TUniDBLookUpxxx bug when datasource and datafield are not assigned - 0000731: Broken TabOrder in 0.82.0 - 0000708: UniGroupBox: Caption assignment when created dynamically - 0000706: ...

    NIST SP800-133.pdf

    data that is sensitive, has a high value, or is vulnerable to unauthorized disclosure or undetected modification during transmission or while in storage. Cryptography relies upon two basic ...

    NIST SP800-133r1-draft.pdf

    data that is sensitive, has a high value, or is vulnerable to unauthorized disclosure or undetected modification during transmission or while in storage. Cryptography relies upon two basic ...

    NIST SP800-53-rev2-final.pdf

    The answers to these questions are not given in isolation but rather in the context of an effective information security program for the organization that identifies, controls, and mitigates risks to ...

Global site tag (gtag.js) - Google Analytics