1. 使用事物的原因 保证数据一致性, 当其中出现一个失败的时候,操作可以回滚 比如: ActiveRecord::Base.transaction do david.withdrawal(100) # withdrawal失败必须触发 exception mary.deposit(100) # d
分类:
其他好文 时间:
2016-02-23 00:56:47
阅读次数:
429
随着生产数据的日志越来越大,硬盘空间越来越小的时候,我们就需要考虑清理一下数据库日志,以前都是手工弄,现在找到一个语句直接自动处理,方便很多,分享一下。 DUMP TRANSACTION CMSDemo WITH NO_LOG BACKUP LOG CMSDemo WITH NO_LOG DBCC
分类:
数据库 时间:
2016-02-22 08:59:32
阅读次数:
180
Spring中如何对数据库进行操作?首先,为项目导入springJDBC所需要的包:commons-dbcp-1.4.jarcommons-pool-1.5.5.jarmysql-connector-java-5.0.0-beta-bin.jarorg.springframework.transaction-3.1.1.RELEASE.jar新建一个spring.xml配置文件1.配置连接池bean:连接池的名字为d..
分类:
编程语言 时间:
2016-02-21 06:51:19
阅读次数:
229
Spring事务管理什么是事务回滚?举个例子:比如转账操作,甲先成功汇给乙现金,若乙没能取款成功,那么甲的现金就应该自动退还Spring提供了很好的事务管理体系Spring要进行事务管理,首先需要导入以下jar包:cglib-nodep-2.1_3.jarorg.springframework.transaction-3.1.1.RELEA..
分类:
编程语言 时间:
2016-02-21 06:40:42
阅读次数:
179
一般不建议做第4,6两步 第4步不安全,有可能损坏数据库或丢失数据 第6步如果日志达到上限,则以后的数据库处理会失败,在清理日志后才能恢复. 1、清空日志 DBCC SHRINKFILE(库名_log,0) DUMP TRANSACTION 库名 WITH NO_LOG 2、截断事务日志: 如果出现
分类:
数据库 时间:
2016-02-18 12:00:55
阅读次数:
338
begin transaction select * from EmployeeInfoTemp WITH (TABLOCK, UPDLOCK) waitfor Delay '00:05:00' commit transaction
分类:
数据库 时间:
2016-02-17 20:45:16
阅读次数:
199
写好的一个存储过程TS_Pro_AddMyBrowse 有返回参数 begin declare d_row int default 0; start TRANSACTION; insert into ts_mybrowse(UserID,ArticleID,FromUserID,ArticleTit...
分类:
数据库 时间:
2016-02-17 13:07:52
阅读次数:
296
Undo the work performed by a series of steps, which together define an eventually consistent operation, if one or more of the steps fail. Operations t...
分类:
其他好文 时间:
2016-02-16 22:10:18
阅读次数:
395
maven库中缺少了这个jar,需要把这个jar安装到本地库中去。 1、下载包含此jar的zip包,地址: http://download.csdn.net/detail/spring123tt/6847843 2、cmd到zip包的目录,运行下面的字符串 mvn install:install-f
分类:
编程语言 时间:
2016-02-16 22:08:25
阅读次数:
463
原文链接:http://www.cnblogs.com/chenty/p/5191777.html 工作中尝尝会遇到各种数据库性能调优,除了查看某条SQL执行时间长短外,还需要对系统的整体处理能力有更全局的掌握。 QPS:Query per second,每秒查询量 TPS:Transaction
分类:
数据库 时间:
2016-02-16 10:01:16
阅读次数:
273