没有合适的资源?快使用搜索试试~ 我知道了~
首页数据库系统原理 电子教程
数据库系统原理 电子教程

《数据库系统原理》是一本全面介绍数据库系统理论、技术和方法的大学教科书,全书分为基础篇、设计篇、实现篇、专题篇和新技术篇。基础篇介绍数据库的基本概念和体系结构、关系数据库系统和数据库的安全性与完整性。设计篇讨论数据库设计的基本步骤和设计方法,并介绍实体-联系模型、扩展的实体-联系模型和关系数据库的函数依赖理论。实现篇介绍数据库的物理存储结构、数据字典、关系代数操作算法、查询优化技术和事务处理技术。专题篇介绍新一代数据库技术及应用、扩展的关系数据库系统、面向对象与对象关系数据库系统、分布式数据库系统和并行数据库技术。新技术篇介绍数据库领域的新进展,包括数据仓库与联机分析、数据挖掘、Web信息检索与Web数据管理技术等。 《数据库系统原理》内容丰富,系统性强,知识体系新颖,理论与实践结合,具有先进性和实用性,是高校计算机、信息与科学计算及信息管理与信息系统等专业本科生和研究生数据库课程教材,也可作为数据库领域从业人员的参考书。《数据库系统原理》还将提供电子课件和实验指导等教辅材
资源详情
资源评论
资源推荐

School of Information Technology
Jiangxi University of Finance & Economics
2007
Database System & Application
Chapter 9 Transactions
Chapter 9 Transactions

2
School of Information Technology, Jiangxi University of Finance & Economics
Database System &
Application
Chapter 9 Transactions
Chapter 9 Transactions
Chapter 9 Transactions
9.1 Transaction Concept
9.2 Transaction State
9.3 Concurrent Executions
9.4 Serializability

3
School of Information Technology, Jiangxi University of Finance & Economics
Database System &
Application
Chapter 9 Transactions
Transaction Concept
Transaction Concept
A transaction is a unit of program execution that accesses and
possibly updates various data items.
E.g. transaction to transfer $50 from account A to account B:
1. read(A)
2. A := A – 50
3. write(A)
4. read(B)
5. B := B + 50
6. write(B)
Two main issues to deal with:
Failures of various kinds, such as hardware failures and system
crashes
Concurrent execution of multiple transactions

4
School of Information Technology, Jiangxi University of Finance & Economics
Database System &
Application
Chapter 9 Transactions
Example of Fund Transfer
Example of Fund Transfer
Atomicity requirement
if the transaction fails after step 3 and before step 6, money will be
“lost” leading to an inconsistent database state
Failure could be due to software or hardware
the system should ensure that updates of a partially executed
transaction are not reflected in the database
Durability requirement
once the user has been notified that the transaction has
completed (i.e., the transfer of the $50 has taken place), the
updates to the database by the transaction must persist even if
there are software or hardware failures.

5
School of Information Technology, Jiangxi University of Finance & Economics
Database System &
Application
Chapter 9 Transactions
Example of Fund Transfer (Cont.)
Example of Fund Transfer (Cont.)
Consistency requirement in above example:
the sum of A and B is unchanged by the execution of the
transaction
In general, consistency requirements include
Explicitly specified integrity constraints such as primary keys and
foreign keys
Implicit integrity constraints
–
e.g. sum of balances of all accounts, minus sum of loan
amounts must equal value of cash-in-hand
A transaction must see a consistent database.
When the transaction completes successfully the database must be
consistent
Erroneous transaction logic can lead to inconsistency
剩余25页未读,继续阅读


















安全验证
文档复制为VIP权益,开通VIP直接复制

评论2