Example of transaction? , Database Management System

Assignment Help:

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.


Related Discussions:- Example of transaction?

What is a recovery scheme, What is a recovery scheme? An integral part ...

What is a recovery scheme? An integral part of a database system is a recovery scheme that can restore the database to the reliable state that existed before the failure.

Define aggregate functions, Define Aggregate functions and what aggregate f...

Define Aggregate functions and what aggregate functions supported by the MySQL To calculate a summary value from a set of individual values and uses one of the functions known

Define mysql_fetch_object(), What are the differences among MySQL_fetch_arr...

What are the differences among MySQL_fetch_array(), MySQL_fetch_object(), MySQL_fetch_row()? Mysql_fetch_object returns the result from the database like objects while mysql

Query optimization, what is meant semantic query optimization? how does it ...

what is meant semantic query optimization? how does it differ from other query optimization techniques?

Explain physical and logical independence, Define Physical and Logical inde...

Define Physical and Logical independence  Ans: Physical data independence: The ability to modify physical level without causing application program to be rewritten. Logic

Define weak and strong entity sets, Define weak and strong entity sets?  ...

Define weak and strong entity sets?  Weak entity  set:  entity  set  that  do not  have  key  attribute  of  their  own are  known as weak entity sets.  Strong entity set

Text mining, Text Processing: Use readLines to read SOU.txt into R. Cr...

Text Processing: Use readLines to read SOU.txt into R. Create a vector called Pres containing the names of the presidents giving each speech. To do this, rst identify the lin

Oracle SQL Developer, Introductory course and so does not require any fancy...

Introductory course and so does not require any fancy coding. I will provide a guidance document to help you in producing the solutions.

Define access time, Define access time. Access time is the time from wh...

Define access time. Access time is the time from when a read or write request is issued to when data transfer starts.

What are called index-sequential files, What are called index-sequential fi...

What are called index-sequential files? The files that are ordered sequentially with a primary index on the search key are known as index-sequential files

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd