3 Pages

Lecture8A_Txn

Course: COMP 5138, Fall 2009
School: Allan Hancock College
Rating:
 
 
 
 
 

Word Count: 906

Document Preview

5138 COMP Relational Database Management Systems Semester 2, 2007 Lecture 8A Transaction Concept L11 Transaction Management Definition A transaction is a collection of one or more operations on one or more databases, which reflects a single real-world transition In the real world, this happened (completely, all at once) or it didnt happen at all Commerce examples Transfer money between accounts Purchase a...

Register Now

Unformatted Document Excerpt

Coursehero >> California >> Allan Hancock College >> COMP 5138

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
5138 COMP Relational Database Management Systems Semester 2, 2007 Lecture 8A Transaction Concept L11 Transaction Management Definition A transaction is a collection of one or more operations on one or more databases, which reflects a single real-world transition In the real world, this happened (completely, all at once) or it didnt happen at all Commerce examples Transfer money between accounts Purchase a group of products, and mark order as filled Student record system Register for a class (either waitlist or allocated) Many DB-based computer systems are mainly used for processing transactions 2 L11 Transaction Management Coding a transaction L11 Transaction Management COMMIT Typically a computer-based system doing OLTP has a collection of parameterized application programs Each program is written in a high-level language, which calls DBMS to perform individual SQL statements Either through embedded SQL converted by preprocessor Or through Call Level Interface where application constructs appropriate string and passes it to DBMS Can use program variables in queries A single SQL statement cant do it all! Need to update several tables Need control flow logic As app program is executing, it is in a transaction Program can execute COMMIT SQL command to finish the transaction successfully The next SQL statement will automatically start a new transaction Even working interactively, all activity on dbms is in a txn Each interactive SQL statement is separate txn 3 4 L11 Transaction Management ROLLBACK L11 Transaction Management Transaction Definition in SQL If the app gets to a place where it cant complete the transaction successfully, it can execute ROLLBACK This causes the system to abort the transaction The database returns to the state without any of the previous changes made by activity of the transaction Rollback can be due to: Program request Client process death System-initiated (eg to deal with deadlock or crash) 5 Data manipulation language must include a construct for specifying the set of actions that comprise a transaction. In many DBMS such as Oracle, a transaction begins implicitly Some other DBMS provide a BEGIN TRANSACTION command A transaction in SQL ends by: Commit commits current transaction and begins a new one. Rollback causes current transaction to abort. 6 1 L11 Transaction Management Transaction Example L11 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. Transaction Management Transaction Example Transaction in Embeded SQL Pseudocode for a product order transaction: START TRANSACTION display greeting get order request SELECT product record If product is available Then UPDATE quantityOnOrder of product record INSERT order record send message to shipping departement End if On Error: ROLLBACK COMMIT EXEC SQL BEGIN DECLARE SECTION int flight; START TRANSACTION char date[10] char seat [3] int occ; EXEC SQL END DECLARE SECTION Void chooseSeat() { /*C code to prompt the user to enter flight, date, and seat and store these in the three with variables those name */ EXEC SQL Select occupied into :occ From Flights Where fltNum=:flight and fltDate=:date and fltSeat=:seat; If (!occ) { EXEC SQL Update Flights Set occupied = true Where fltNum=:flight and fltDate=:date and fltSeat=:seat; /*C and SQL code to record the seat assignment and inform the user of the assignment */ } Else /* C code to notify user of unavailability and ask for another seat selection */ } 7 8 L11 Transaction Management Atomicity L11 Transaction Management Integrity Two possible outcomes for a transaction It commits: all the changes are made It aborts: no changes are made That is, transactions activities are all or nothing Also, the decision is irrevocable; so once committed, the transaction cant revert to aborted Changes are durable A real world state is reflected by collections of values in the tables of the DBMS But not every collection of values in a table makes sense in the real world The state of the tables is restricted by integrity constraints Perhaps, but not always, declared explicitly in the database schema Eg foreign key constraint, primary key constraint 9 10 L11 Transaction Management Consistency L11 Transaction Management System threats to data integrity Each transaction can be written on the assumption that all integrity constraints hold in the data, before the transaction runs It must make sure that its changes leave the integrity constraints still holding However, there are allowed to be intermediate states where the constraints do not hold A transaction that does this, is called consistent This is an obligation on the programmer Usually the organization has a testing/checking and sign-off mechanism before an application program is allowed to get installed in the production system Need for application rollback Previous sta...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Allan Hancock College - COMP - 5138
School ofInformation TechnologiesSchool of IT J12 NSW 2006 AUSTRALIA Telephone +61 2 9351 3423 Facsimile +61 2 9351 3838COMP5138 (Semester Two 2007)Relational Database Management SystemsTutorial Week 13RevisionQuestion 1This question deals
Allan Hancock College - COMP - 5138
School ofInformation TechnologiesSchool of IT J12 NSW 2006 AUSTRALIA Telephone +61 2 9351 3423 Facsimile +61 2 9351 3838COMP5138 (Semester Two 2007)Relational Database Management Systems Tutorial 11 TransactionsQuestion 1: Durability and Restar
Allan Hancock College - COMP - 5138
COMP 5138 Relational Database Management SystemsSem 2, 2007 Lecture 1 Introduction to Database SystemsL1Overview & IntroductionWhat is a DBMS?Data: Facts that can be recordedImportant for users Need to persist (not just temporary values us
Allan Hancock College - COMP - 5138
COMP5138 Week 4 Tutorial (Semester 2, 2007)This tutorial develops your skills in design theory and normalization. Question 1. Suppose we have a database for an investment firm, consisting of a single relation R(BrokerName, Office, InvestorId, StockN
Allan Hancock College - COMP - 5138
School ofInformation TechnologiesSchool of IT J12 NSW 2006 AUSTRALIA Telephone +61 2 9351 3423 Facsimile +61 2 9351 3838COMP5138 (Semester Two 2007)Relational Database Management SystemsTutorial Week 9Storage and IndexingIntroduction In this
Allan Hancock College - COMP - 5138
School ofInformation TechnologiesSchool of IT J12 NSW 2006 AUSTRALIA Telephone +61 2 9351 3423 Facsimile +61 2 9351 3838COMP5138 (Semester Two 2007)Relational Database Management SystemsTutorial 7DB Application DevelopmentIntroduction In thi
Colorado - PHIL - 3100
Philosophy 3100 Ethical Theory Spring 2009 Syllabus Professor Chris Heathwood Office: Hellems 192 Office Hours: Wed., 3:30-5:30, and by appt. Course DescriptionMWF 12:00-12:50 EDUC 231Email: heathwood@colorado.edu Phone: (303-73) 5-0450We make
Allan Hancock College - COMP - 5348
School ofInformation TechnologiesCOMP5348 Enterprise-Scale Software Architecture6 Credit Points Unit of Study Outline & Assessment Details Semester 1, 20091IMPORTANT: Policy relating to Academic Dishonesty and Plagiarism.The School of Infor
Allan Hancock College - COMP - 5318
School ofInformation TechnologiesUnit COMP5318 Knowledge Discovery and Data Mining6 Credit Points Unit of Study Outline & Assessment Details Semester 2, 20081IMPORTANT: Policy relating to Academic Dishonesty and Plagiarism.The School of Inf
Neumont - EN - 1974
R.C.SECCLESBOURQUE739John KennethEcciesPlaintiffAppellantandBourqueDefendantsSimmonds andRespondentsWise1974 May 24 1974 October11Present Laskin Spence Pigeon and Martland Judson DicksonRitchieBeetz and de Grandpr JJON
Neumont - CSC - 1974
R.C.SECCLESBOURQUE739John KennethEcciesPlaintiffAppellantandBourqueDefendantsSimmonds andRespondentsWise1974 May 24 1974 October11Present Laskin Spence Pigeon and Martland Judson DicksonRitchieBeetz and de Grandpr JJON
Allan Hancock College - STAT - 3911
STAT 3011/3911 Semester 1 Time Series Analysis Assignment 1 Due Friday 27 March, 2009. 1. A plot of a time series, {xt }, against time shows a quadratic trend and a seasonal component of period 4. Write xt = mt + st + t , where mt = + t + t2 , st =
Allan Hancock College - MATH - 3962
THE UNIVERSITY OF SYDNEY MATH3962: Rings, Fields and Galois Theory Semester 1 Homework 1 2009This homework exercise is set for you get feedback on writing out proofs of elementary results. If you would like some help getting started, or would to di
Wisconsin - AAE - 336
MARVIN KATKO, Appellee v. EDWARD BRINEY and BERTHA L. BRINEY, Appellants No. 54169 Supreme Court of Iowa 183 N.W.2d 657; 1971 Iowa Sup. LEXIS 717; 47 A.L.R.3d 624February 9, 1971, Filed PRIOR HISTORY: [*1] Appeal from Mahaska District Court. Harold
Dallas - EE - 4301
-2 22 1y 1 2 -1 0z 0 -1 -2 02 x4-2 2 2 1 0 -1 -2y 1 2 -1 002 x4THE UNIVERSITY OF TEXAS AT DALLASErik Jonsson School of Engineering and Computer ScienceATTENUATION IN COAXIAL CABLEAttenuation vs. frequency for typical coaxial
Dallas - EE - 6317
Summer 2008 Assignment 6Due Date:July 23, 2008Reading:Eugene Hecht, Optics, Fourth Edition, Chapters 7 and 8Reference Material:Dr. Cantrells slides on diraction theory Dr. Cantrells notes on diraction theoryProblems:Please write your answe
Dallas - EE - 6317
Summer 2008 Assignment 2Due Date:June 11, 2008Reading:Eugene Hecht, Optics, Fourth Edition, Chapters 7 and 8Reference Material:Dr. Cantrells notes on time-domain and frequency-domain analysis of transmission lines Dr. Cantrells slides on inte
Colorado - ECON - 4818
b1 = n 1 (x1i x 1 ) i= (xn i =12i x 2 )(x1i x1 )2i (xn i =1 2 x2 )2 (x 2i x 2 ) yi 2 (xn i =11i x1 ) n ( x2i x 2 )(x1i x1 ) i =1 .(13.1) (xn i =12i x2 )2V (b1 )n n 1 ( x2i x2 )(x1
Wisconsin - BME - 402
Defibrillator Tester for Engineering World Health Week March 4, 2005 March 10, 2005 Team Members : Evan Rogers Co Team Leader Joe Hippensteel Co Team Leader Nina Lewis Communications Ashley Phillips BWIG Tyler Allee BSAC Advisor/Client : John
Wisconsin - BME - 200
Glaucoma Medication Electronic Reminder/Compliance Aid (Team 35) Week September 15th, 2006 September 21st, 2006 Team Members: Chris Webster - Team Lead Ksenija Bujanovic - Communication Mike Oldenburg - BWIG Jessica Hause BSACClient: Leo Wang De
Wisconsin - BME - 300
Project # 18 Devel opm ent of a Device f or Neu roc he mical Sa mpl e Col lecti on fro m F reel y M oving M onke ys Team Members: Cole Drifka (Co-Leader), Lauren Eichaker (Co-Leader), Ben Fleming (BWIG), Adam Pala (Communicator), Sarah Springborn (B
Wisconsin - BME - 300
ECG-Training DeviceProgress Report 2 February 4, 2009 February 10, 2009Team Members: Laura Bagley (Team Leader) bagley@wisc.edu Cali Roen (BWIG) roen@wisc.edu Anthony Schuler (BSAC) aschuler@wisc.edu Amy Weaver (Communicator) aweaver@wisc.edu Clie
Penn State - MJF - 283
Transactions of the Royal Society of Tropical Medicine and Hygiene (2006) xxx, xxx-xxxavailable at www.sciencedirect.comjournal homepage: www.elsevierhealth.com/journals/trstEstimating transmission intensity for a measles epidemic in Niamey, Ni
Penn State - SAM - 521
Warning Concerning Copyright RestrictionsThe copyright law of the United States (Title 17, United States Code) governs the reproduction of copyrighted material. Under certain conditions specified in the law, libraries and archives are permitted to f
Neumont - EN - 1975
R.C.SENT LAFLEURetCOMMLEROYER101Les Entreprises LafleurAppellant and1961LimiteJrmeLe RoyerSchoolCommissionof suitRespondent andin continuanceAttorney General of the Province Respondentand Eastern and Registrar en ca
Neumont - CSC - 1975
R.C.SENT LAFLEURetCOMMLEROYER101Les Entreprises LafleurAppellant and1961LimiteJrmeLe RoyerSchoolCommissionof suitRespondent andin continuanceAttorney General of the Province Respondentand Eastern and Registrar en ca
Neumont - EN - 1969
R.C.STOTTRUPPATTERSONLe Juge enChef323Tartan Brewing Appellant andLimitedDefendantTheCarling BreweriesB.CLimitedPlaintiffRespondent 1969 November 13 14 1969 November 14Present andCartwrightC.JandAbbottHallSpenc
Wisconsin - MATH - 221
MATH 221: Calculus and Analytic Geometry Prof. Ram, Fall 2006 HOMEWORK 13 DUE December 8, 2006 Problem A. Motion. (1) What do distance, speed and acceleration have to do with calculus? Explain thoroughly. (2) A particle, starting from a xed point P ,
Penn State - HST - 5004
Print Preview2/16/09 11:05 AM01.14.09 Social Studies Marry CassattDesigner/Author: Helene Tack 01/11/2009 10:27:00 AM ESTBASIC INFORMATIONGrade/Level: Date to be Taught: Time Frame: Subject: Topic: Summary: 3 January 14 and 15, 2009 2 class p
Maryland - ENEE - 621
University of Maryland at College Park Department of Electrical and Computer EngineeringENEE 621 Estimation & Detection TheoryProblem Set 6 Spring 2005 Issued: Monday, March 14, 2005 Due: Monday, March 28, 2005Exam 1 reminder: The exam will take
Maryland - ENEE - 324
ENEE 324Solutiony= xHomework 071. (Similar to Peebles 4.5-5) Random variables X and Y are jointly distributed with25 2 xy 16fXY (x, y) =00<y<x<2 elsewhere0x=2yx(a) Find the marginal densities fX (x) and fY (y). For a xed x
Wisconsin - ECE - 352
ECE/CS 352LECTURE 1 NUMBER SYSTEMS, ARITH. & CODESECE/CS 352NUMBER REPRESENTATION (Continued)NUMBER REPRESENTATION (An An-1 . A1 A0. A1 A2 . Am) r Note radix, radix point, most significant digit, least significant digit. Range of digits: 0
Wisconsin - ECE - 352
Department of Electrical and Computer Engineering University of Wisconsin - MadisonECE/Comp. Sci. 352 { Digital System FundamentalsFinal Suggested Solution1. (25 points) Short Questions (a) (5 points) Convert (3A:B )12 into a decimal number. Roun
Wisconsin - ECE - 755
SEMICONDUCTOR MEMORIESDigital Integrated CircuitsMemory Prentice Hall 1995Chapter Overview Memory Classification Memory Architectures The Memory Core Periphery ReliabilityDigital Integrated CircuitsMemory Prentice Hall 19951Sem
Toledo - ENV - 200
2007TermTestAnswers Sustainability,HealthandRisk1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. A+E D(2pts) C(2pts) A B E A+C A E A,C+E+D D D+C(2pts) B(2pts) B(2pts
Toledo - PHY - 132
In-Class Quiz 1 - QuestionThe Mid-Term Test was: A. Too easy B. Easy C. Just right D. Hard E. Too hardIn-Class Quiz 1 - AnswerThe Mid-Term Test was: A. Too easy B. Easy C. Just right D. Hard E. Too hard F. My answer depends on my grade!PHY132S
Toledo - PHY - 132
In-Class Quiz 1 - Question (2006 test)X and Y are two uncharged metal spheres mounted on insulating stands, and are in contact with each other. A positively charged rod is brought close to (but not touching) sphere X as shown in the figure below. Sp
Toledo - PHY - 132
In-Class Quiz 1 - Question (2007 Test)Four charged particles are distributed as shown, each equidistant from the origin. In which direction is the net electric field at point P? A. Directly upwards (+y direction) y P B. Directly downwards (-y direct
Penn State - LRN - 5006
A Closer Look at Gender Representation in ArtPalmer Museum of Art, Second Floor Walter McEwen, Dutch Interior, 1886 Jerry Kearns, Affirmative Action, 1987PART I: Interpreting Dutch Interior by Walter McEwen Discuss with your partner and write down
Wisconsin - AAE - 462
Lecture 3AAE/Econ/IntlBus 462 January 28, 2008General Outline of Todays Class 1. Regression Analysis 2. Latin American Economic History 1820-1940 3. Mexican Industrialization 1830-1940 4. Summary of Historical Section Detailed Class Notes 1. Quick
Wisconsin - AAE - 462
Lecture 13AAE/Econ/IntlBus 462 March 9, 2009The midterm is Wendesday March 11th and will cover all the material up through todays lecture. Have a great spring break! Dont forget that on Monday March 30th you must hand in a list with at least three
Wisconsin - BOTANY - 401
Endangered and Threatened Species of the Great Lakes Region1. The value of Biodiversity 2. The Endangered Species Act 3. Endangered Wisconsin flora 4. How do species become endangered? 5. What can or should be done? The term BioDiversity was born
Wisconsin - ENGR - 476
EP 476 Lesson Plan Class 1, 1/22/08: Introduction and computing environment basics OBJECTIVES: Provide motivation for learning traditional computing skills Cover basic UNIX commands Introduce shells OUTCOMES: Students shall be able to execute bas
Wisconsin - ENGR - 476
EP/EMA/NE 476, Spring 2008 Ungraded Exercise 2, 1/29/08 Copy trash_skel from ~csovinec/ep476/scripts (also copied below) and complete the sections indicated by capitalized instructions (also boldface here). Test the operation of your completed script
Maryland - CLASSICS - 170
Assignment for April 25-26: SophoclesPhiloctetes (in Sophocles Electra and other Plays)Write 300 words on ONE of the following, USING REFERENCES IN THE PLAY to support your ideas: 1. Should Philoctetes go to Troy? Why or why not? (think about what
Maryland - CLASSICS - 170
Classics 170 Greek and Roman MythologyProfessor Hugh Lee No oversubscription. You must go through the oversubscription registration process to be enrolled in this course. Please take a syllabus. Your first assignment for discussion is on the syll
Wisconsin - HOMEPAGES - 379
Simple CVS TutorialECE 379: Introduction to Computer Engineering University of Wisconsin Madison Prof. Mikko H. Lipasti TA: Payam Karbassi CVS (Concurrent Versions System) is a simple software engineering tool that allows you to store multiple conc
Wisconsin - CAE - 379
Simple CVS TutorialECE 379: Introduction to Computer Engineering University of Wisconsin Madison Prof. Mikko H. Lipasti TA: Payam Karbassi CVS (Concurrent Versions System) is a simple software engineering tool that allows you to store multiple conc
CSU Long Beach - READ - 397
Rorschach Tested Blot out the famous method? Some experts say it has no place in psychiatry.LA Times [May 19, 2003; F1, F5]By Rosie Mestel, Times Staff WriterThe red-and-black splashes on the card are bustling with images: bad-tempered crows, a
Wisconsin - ECE - 601
Technology Specification For ECE601 Final Project April 2001.1.Setup File: Use .synopsys_dc.setup file, which is now available in the course webpage. Save it into you home directory or your design directory. DESIGN ATTRIBUTES 2. Operating Conditions
Wisconsin - AOS - 311
Stephen Ogden 2/27/09 Lecture Summary First, we learned how to scale the thermodynamic equation for large scale motion, J V g T -S p = , t Cp where, Sp=-T ln . Next, we found that we couldn't remove vertical motion, , pfrom the equation, as t
Wisconsin - AOS - 100
AOS 100/101 Spring 2009 SOLUTIONS HOMEWORK #31) (a) If the Earths axis were tilted at 45 instead of the current 23.5, the summer sun over Madison would be higher in the sky resulting in more intense insolation. Also, the days would be longer. This
Wisconsin - AOS - 452
1AOS452Lab1:MeteorologicaldatadecodingandforecastpreparationThissemesterwewillbeusingavarietyofprogramsandsoftwarespecifictometeorology.The firstprogramwewillfocusonis: THEWEATHERPROGRAM Theweatherprogramisavaluabletoolforviewingavarietyoftextweat
UConn - M - 223
Third Project: Math 223 Due April 22, 2005This project will explore tilings of the Euclidean plane. A tiling is a repeated pattern of shapes that covers the plane without overlapping or leaving gaps. For instance, the unit squares with integer verti
UConn - EDCI - 5830
International Journal of Teaching and Learning in Higher Education http:/www.isetl.org/ijtlhe/2006, Volume 18, Number 3, 180-187 ISSN 1812-9129How Do Faculty Experience and Respond to Classroom Conflict?Steven A. Meyers and James BenderRoosevel
UConn - EDCI - 5830
Tips for Teachers - Participatory LecturesDerek Bok Center for Teaching and Learning, Harvard University | ONLINE DOCUMENTTIPS FOR TEACHERS:TWENTY WAYS TO MAKE LECTURES MORE PARTICIPATORYLectures play a vital role in teaching. There will alway
UConn - EDCI - 5830
Print: The Chronicle: 4/2/2004: Thwarting Misbehavior in the Clas.http:/chronicle.com/cgi-bin/printable.cgi?article=http:/chronicle.c.From the issue dated April 2, 2004 http:/chronicle.com/weekly/v50/i30/30b01401.htmThwarting Misbehavior in the
UConn - EDCI - 5830
Pitt faculty model active learning strategiesPitt faculty model strategies to engage learners in large classesThe first few classes are crucialBruce Goldstein, Psychology, engages students with class activities that encourage them to participate
Neumont - EN - 1952
Supreme Court of Canada Azoulay v. The Queen; [1952] 2 S.C.R. 495 Date: 1952-11-04LEON AZOULAY APPELLANT AND HER MAJESTY THE QUEEN RESPONDENT. PRESENT: Rinfret C.J. and Taschereau, Rand, Estey and Fauteux JJ. ON APPEAL FROM THE COURT OF KING'S BENCH
Neumont - CSC - 1952
Supreme Court of Canada Azoulay v. The Queen; [1952] 2 S.C.R. 495 Date: 1952-11-04LEON AZOULAY APPELLANT AND HER MAJESTY THE QUEEN RESPONDENT. PRESENT: Rinfret C.J. and Taschereau, Rand, Estey and Fauteux JJ. ON APPEAL FROM THE COURT OF KING'S BENCH
Wisconsin - TOMPKINS - 701
Biomedical Engineering Seminar Lunch Program J. G. Webster and W. J. Tompkins Department of Electrical and Computer Engineering Sponsored by Burdick, Ohmeda, Marquette Electronics 1994-1995 Date Topic Speaker 7/18/94 Identification of arrhythmic foci