- 浏览: 375011 次
- 来自: 北京
文章分类
- 全部博客 (237)
- XML (6)
- JavaSE (39)
- Junit (1)
- Maven (10)
- JavaScript (12)
- JavaEE (16)
- HTML5 (10)
- java多线程 (8)
- Hibernate (30)
- Java反射 (3)
- Spring (11)
- Struts (1)
- svn (2)
- linux (12)
- 代码实例 (1)
- 设计模式 (1)
- UML (1)
- javassist (1)
- Oracle (3)
- Hibernate异常 (9)
- DWR (6)
- Java泛型 (2)
- SpringMVC (11)
- Dbunit (3)
- github (2)
- Algorithm (1)
- zTree (1)
- jquery (7)
- freemarker (4)
- mysql (5)
- ffmpeg (1)
- 编码 (1)
- lucene (15)
- hadoop (1)
- JVM (1)
- Regular Expressions (5)
- myeclipse (1)
- 爬虫 (7)
- 加密 (3)
- WebService (2)
- Socket (2)
- Windows (1)
最新评论
-
wxpsjm:
好直接
HV000030: No validator could be found for type: java.lang.Integer. -
wxhhbdx:
学习了,对新手来说很不错的教程。
SpringMVC入门 (二) 数值传递 -
xgcai:
正好在学dwr
DWR入门 (二)用户实例
Connection is read-only. Queries leading to data modification are not allowed。
<tx:advice id="txAdvice" transaction-manager="txManager"> <tx:attributes> <!-- 让所有的方法都加入事务管理,为了提高效率,可以把一些查询之类的方法设置为只读的事务 --> <!-- method name=*, readonly=true表示所有的数据库操作都可以使用,但是只能是读取数据库。 例如有UserService的方法 listUsers, 获取所有用户,就没问题。 但是如果是UserService的方法delUser, 要在dao层删除用户。就会报错误如下: Connection is read-only. Queries leading to data modification are not allowed。 因此要添加下面的每一个add*,del*,update*等等。 分别给予访问数据库的权限。 --> <tx:method name="*" propagation="REQUIRED" read-only="true" /> <!-- 以下方法都是可能设计修改的方法,就无法设置为只读 --> <tx:method name="add*" propagation="REQUIRED" /> <tx:method name="del*" propagation="REQUIRED" /> <tx:method name="update*" propagation="REQUIRED" /> <tx:method name="save*" propagation="REQUIRED" /> <tx:method name="create*" propagation="REQUIRED" /> <tx:method name="clear*" propagation="REQUIRED" /> </tx:attributes> </tx:advice>
在上面的beans.xml配置中, 一开始没有配置add*,del*,update*等等。 就会在调用相应的方法时出错。
而获取数据则没有问题, 是因为有
<tx:method name="*" propagation="REQUIRED" read-only="true" />
发表评论
-
Spring测试 @ContextConfiguration("appContext.xml")
2014-07-03 11:53 0这里记录一下用maven+spring来进行junit测试。 ... -
org.hibernate.HibernateException: No Session found for current thread
2014-04-06 12:37 0今天在maven中整合spring和hibernate,并使用 ... -
select new Topic from ' Mysql 生成SQL语句错误
2014-03-30 22:51 1648Caused by: com.mysql.jdbc.exce ... -
Superclass has no null constructors but no arguments were given
2014-03-28 23:21 2127org.springframework.aop.framewo ... -
Unable to locate appropriate constructor on class
2014-02-20 00:11 1457org.hibernate.hql.internal.ast. ... -
Superclass has no null constructors but no arguments were given
2014-01-25 13:59 2174org.springframework.beans.fact ... -
Hibernate的load和get实际应用区分简单实例
2013-12-18 11:58 866今天在看孔浩的CMS视频时候看到的。 在57 -文章管理06 ... -
自定义OpenSessionInViewer过滤器
2013-12-11 12:12 1051摘自孔浩视频 spring部分-17_spring_SSH整合 ... -
Spring AOP入门 (四)基于XML配置
2013-12-10 19:07 1333首先修改LogAspect.java,这 ... -
Spring AOP入门 (三)基于Annotation
2013-12-10 15:59 1123这里讲如何使用Annotation来实现Spring的AOP功 ... -
Spring AOP入门 (二)动态代理
2013-12-09 22:47 867动态代理指的是通过一个代理对象来创建需要的业务对象,然后在这个 ... -
Spring AOP入门 (一)静态代理
2013-12-09 18:12 1037开发中我们会需要对某些方法做日志记录。 一种最简单的方法是, ... -
Spring配置CharacterEncodingFilter
2013-12-09 15:39 879在web.xml中配置: <filter> ... -
数据库事务 (三)虚读(Phantom Read)
2013-12-01 13:21 0关于各种读 虚读 phantom read: 转自维基 ... -
Hibernate悲观锁
2013-11-30 17:30 0为了防止两个线程同时修改一个数据,造成更新数据丢失,我们可以使 ... -
Hibernate查询HQL实例
2013-11-29 15:56 1289三个实体类对象: public class Team { ... -
QBC与HQL检索
2013-11-28 17:39 0QBC(Query By Criteria) API提供了检索 ... -
Hibernate继承映射
2013-11-28 12:36 644继承映射分为三种情况 1.每个子类一张表 比如说有一个Pers ... -
Hibernate通过Composite-element配置外联表实例 (码)
2013-11-28 11:07 1010摘自圣思园Hibenrate 26. 组件映射深度解析 -37 ... -
Hibernate配置复合主键 composite primary key (二)
2013-11-27 16:41 1442摘自圣思园Hibernate 26.组件映射深度解析 上一篇 ...
相关推荐
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 ...
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.
在IT行业中,"mod"通常是"module"或"modification"的缩写,这可能是一个用于扩展或修改应用程序功能的组件。在这种情况下,“header”可能指的是HTTP头部,因为这是网络通信中非常重要的一部分,尤其是对于Web开发和...
* 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 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.
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 ...
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)
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 ...
7. **标准化流程**:说明了O-RAN联盟的标准化流程,包括CR(Change Request)的处理,如RBBN.AO-2021.06.25-WG1-CR-0001-Annex-TN-Slicing-v06和JNPR-2021.05.31-WG1-CR-0004-O-RAN-Slicing-ONSSI-Modification-v02...
- **License:** Geronimo is distributed under the Apache License, Version 2.0, which allows for free use and modification while preserving the rights of contributors. #### Why Another Application ...
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.
IDataObject.GetData to be called before IDropTarget.Drop is called. ------------------------------------------- 5. Support and feedback: ------------------------------------------- Since these ...
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...
MOD全称是Modification,通常由玩家或第三方开发者制作,用于改变游戏的玩法、视觉效果、增加新功能或内容。因此,"Automate"可能是一个允许玩家自动化游戏内某些过程的工具,例如资源采集、建筑过程或角色行为。 ...
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 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.
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....
在IT行业中,MOD是“Modification”的缩写,通常由玩家或第三方开发者为已有的游戏创建,以增加新的功能、内容或改变游戏机制。SnakeBite可能是某个游戏的MOD,旨在提升游戏体验或提供独特的玩法。 标签同样为 "MOD...
printf("Before modification: %d\n", globalVar); modifyGlobalVar(); printf("After modification: %d\n", globalVar); return 0; } // 文件2: util.c extern int globalVar; // 外部变量声明 void ...
MOD,全称“ Modification”,是指玩家对原版游戏进行修改,以增加新的功能、角色、剧情或者改变游戏原有体验的一种方式。这款MOD资源包针对的是《Dying Light: The Following - Enhanced Edition》的版本1.10到1.15...