JDBC的事务隔离级别 : 交易事务 « 数据库 « Java 教程

En
Java 教程
1. 语言基础
2. 数据类型
3. 操作符
4. 流程控制
5. 类定义
6. 开发相关
7. 反射
8. 正则表达式
9. 集合
10. 线
11. 文件
12. 泛型
13. 本土化
14. Swing
15. Swing事件
16. 二维图形
17. SWT
18. SWT 二维图形
19. 网络
20. 数据库
21. Hibernate
22. JPA
23. JSP
24. JSTL
25. Servlet
26. Web服务SOA
27. EJB3
28. Spring
29. PDF
30. 电子邮件
31. 基于J2ME
32. J2EE应用
33. XML
34. 设计模式
35. 日志
36. 安全
37. Apache工具
38. 蚂蚁编译
39. JUnit单元测试
Java
Java 教程 » 数据库 » 交易事务 
20. 32. 1. JDBC的事务隔离级别
Connection.setTransactionIsolation (level)
JDBC Defined ConstantDescription
TRANSACTION_READ_UNCOMMITTEDAllows dirty reads, non-repeatable reads, and phantom reads to occur.
TRANSACTION_READ_COMMITTEDEnsures only committed data can be read.
TRANSACTION_REPEATABLE_READIs close to being "serializable," however, "phantom" reads are possible.
TRANSACTION_SERIALIZABLEDirty reads, non-repeatable reads, and phantom reads are prevented. Serializable.


A "phantom" read occurs when one transaction reads all rows that satisfy a WHERE condition, and a second transaction inserts a row that satisfies that WHERE condition, the first transaction then rereads for the same condition, retrieving the additional "phantom" row in the second read. (from book: JDBC Recipes A Problem-Solution Approach)

In addition, JDBC defines an additional constant, TRANSACTION_NONE, which is used to indicate that the driver does not support transactions.

20. 32. 交易事务
20. 32. 1. JDBC的事务隔离级别
20. 32. 2. 事务隔离级别
20. 32. 3. 确定是否数据库支持交易
20. 32. 4. Autocommit模式
20. 32. 5. 回滚事务
20. 32. 6. 交易中使用的JDBC捕获异常
20. 32. 7. 回滚到保存点
20. 32. 8. 使用数据库JDBC交易
20. 32. 9. 确定数据库是否支持交易
20. 32. 10. Commit和倒退更新
20. 32. 11. 停用自动commit模式
20. 32. 12. 如果数据库支持交易
20. 32. 13. 回滚交易
www.java2java.com | Contact Us
Copyright 2010 - 2030 Java Source and Support. All rights reserved.
All other trademarks are property of their respective owners.