Example of transaction? , Database Management System

Example:; transfers transfer_amount from x's account to y's account

; Supposes x&y both accounts exist

TRANSACTION (x, y, transfer_amount)

Start transaction

IF X AND Y exist then

READ x.balance

IF x.balance > transfer_amount THEN

x.balance = x.balance - transfer_amount

READ y.balance

y.balance = y.balance + transfer_amount

COMMIT

ELSE DISPLAY ("BALANCE IN X NOT OK") ROLLBACK

ELSE DISPLAY ("ACCOUNT X OR Y DOES NOT EXIST") End_transaction

Please note the use of 2 keywords here COMMIT and ROLLBACK. Commit makes sure that all the modifications made by transactions are made permanent. ROLLBACK ends the transactions and discards any change made by the transaction. Transactions have definite desirable properties. Let us see into those properties of a transaction.

Posted Date: 3/11/2013 5:19:23 AM | Location : United States







Related Discussions:- Example of transaction? , Assignment Help, Ask Question on Example of transaction? , Get Answer, Expert's Help, Example of transaction? Discussions

Write discussion on Example of transaction?
Your posts are moderated
Related Questions
Describe the host language? Host Language: You could write applications along with SQL statements embedded inside a host language. The SQL statements give the database inter

What are the situations while DBMS should not be used? DBMS should not be used in situations like: (i) No need of security. (ii) Not difficulty to access the data (iii) N

QUESTION (a)(i) Define the term database. (ii) How is it different from a database management system? (b) What is the difference between an entity and an attribute? (c

In E-R Diagram how relationship type is represented ? In E-R Diagram relationship type is represented as a Diamond.

Question : Mr. Smith Harry has a car manufacturing company which has recently integrated management information system. He wishes to obtain more information on ethics and socia

Consider a relation s over the attributes A and B with the following characteristics: 5,000 tuples with 10 tuples per page A 2-level B+ tree index on attribute

Order by clause By using this rows can be sorted It is used in the last portion of select statement By default it gets ascending order DESC: is used

Question 1 List and explain various Normal Forms. How BCNF differs from the Third Normal Form and 4th Normal forms? Question 2 Describe the concepts of Structural Semantic Da

Explain the term - Control as Concurrent Tasks As we know, any object can be implemented as a task in programming language or operating system. This is the most general approa

What is OCR? OCR (Optical Character Recognition) is a technology that enables you to change different types of machine-readable documents, like scanned paper documents, PDF fil