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?

Define a relation in dbms, Define a relation ? Relation - A relations...

Define a relation ? Relation - A relations is a named two-dimensional table of data. Mathematically, a relation can be described as a subset of the cartesian product of a lis

Database, . Ashutosh Dubey who is the director of Gyan Gurukul want a three...

. Ashutosh Dubey who is the director of Gyan Gurukul want a three-level schema architecture for the Gyan Gurukul Company that provide better security also design a data abstraction

Explain data models namely relational network - hierarchical, Explain the t...

Explain the three data models namely relational, network and hierarchical and evaluate their relative advantages and disadvantages. Hierarchical Model: In hierarchical model, da

Field, examples of fields in a database

examples of fields in a database

Describe the objective of structural diagrams, Describe the objective of St...

Describe the objective of Structural Diagrams The main objective of structural diagram is to visualize, construct, specify and document static aspects of a system. Their eleme

How does oracle act as odbc and give example for front end, How does Oracle...

How does Oracle act as ODBC and give examples of front end uses with ODBC? ODBC achieve portability at the level of the executable by introducing an extra level of indirection.

Describe how you can simplify operations, Describe how you can simplify Ope...

Describe how you can simplify Operations. To simplify operation, one should use inheritance, where possible to use, to reduce the quantity of distinct operations. Introduce new

The tools that are available for managing mysql server, Describe the tools ...

Describe the tools that are available for managing MySQL Server. Given below are the tools to manage MySQL server: mysqld - MySQL server daemon. This is used to begain t

Project on designing and creating a database , This project will involve de...

This project will involve designing and creating a database for an organization.  In the design of a database, there is no single "perfect" design.  So your database design may not

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