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?

State the meaning of self-transition, What is self-transition? ...

What is self-transition? If there is a transition which goes back to same state, it is known as "self- transition." With a trigger action exit action would be executed f

What is multilevel index, Multilevel Index The Multilevel Index is a m...

Multilevel Index The Multilevel Index is a modification of the secondary level index system. In this system we might be use even more number of levels in case the table is eve

Write modified version of transfer that avoids deadlock, Your OS has a set ...

Your OS has a set of queues, each of which is protected by a lock. To enqueue or dequeue an item, a thread must hold the lock associated to the queue. You need to implement an a

Describe the ways for selecting data structure, Ways for Selecting Data Str...

Ways for Selecting Data Structure Algorithms operate on data structure. Therefore, selection of the best algorithm means selecting the best data structure from whole bunch. Th

Define the terms- ddl and dml, Define the terms   i) DDL   ...

Define the terms   i) DDL   ii) DML   DDL: Data base schema is specified by a set of definitions expressed by a special   language known as a data def

Define outer union operation of the relational algebra, Define outer union ...

Define outer union operation of the relational algebra. Compute the outer union for the relations R and S given below. Outer Join - If there are any values in one tabl

What are multiple inheritances, What are multiple inheritances? Multipl...

What are multiple inheritances? Multiple inheritances allow a class to inherit variables and methods from many super classes.

Original Database, I need an ERD created for any original database(can be o...

I need an ERD created for any original database(can be on anything). It needs to be 3NF. I then need all the CREATE STATEMENTS, INSERT STATEMENTS(anything you can think of as long

List some instances of collection types, List some instances of collection ...

List some instances of collection types? a) sets b) arrays c) multisets

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