Duke CPS 116 - SQL: Transactions (4 pages)

Previewing page 1 of 4 page document View the full content.
View Full Document

SQL: Transactions



Previewing page 1 of actual document.

View the full content.
View Full Document
View Full Document

SQL: Transactions

113 views


Pages:
4
School:
Duke University
Course:
Cps 116 - Introduction to Database Systems
Introduction to Database Systems Documents

Unformatted text preview:

Announcements October 2 Project 2 milestone 1 due in 1 weeks Come to my office hours if you want to chat about project ideas SQL Transactions Midterm CPS 116 Introduction to Database Systems in class this Thursday Open book open notes Format similar to the sample midterm Covers everything up to today s lecture Emphasizes materials exercised in homeworks Sample solutions to sample midterm and Homework 2 available Transactions 3 A transaction is a sequence of database operations with the following properties ACID 5 operations e g CREATE TABLE implicitly commit the current transaction Schema Because it is often difficult to undo a schema operation DBMS support an AUTOCOMMIT feature which automatically commits every single statement Many For DB2 db2 command line processor turns it on by default You can turn it off with option c More examples to come when we cover database API s 4 A transaction is automatically started when a user executes an SQL statement Subsequent statements in the same session are executed as part of this transaction Atomic Operations of a transaction are executed all ornothing and are never left half done Consistency Assume all database constraints are satisfied at the start of a transaction they should remain satisfied at the end of the transaction Isolation Transactions must behave as if they were executed in complete isolation from each other Durability If the DBMS crashes after a transaction commits all effects of the transaction must remain in the database when DBMS comes back up Fine prints SQL transactions Statements see changes made by earlier ones in the same transaction Statements in other concurrently running transactions do not see these changes COMMIT command commits the transaction ROLLBACK command aborts the transaction Its effects are made final and visible to subsequent transactions Its effects are undone Atomicity Partial 6 effects of a transaction must be undone when User explicitly aborts the transaction using ROLLBACK E g



View Full Document

Access the best Study Guides, Lecture Notes and Practice Exams

Loading Unlocking...
Login

Join to view SQL: Transactions and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view SQL: Transactions and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?