Showing posts with label Transaction Management. Show all posts
Showing posts with label Transaction Management. Show all posts

Monday, April 4, 2016

Types of failures that causes a transaction to fail

Types of failures that causes a transaction to fail, Reasons for transaction failures, List the reasons for transaction failure in dbms, transaction failure


Types of failures that causes a transaction to fail


A transaction may fail due to one or more following reasons;


  • Computer failure (System crash) – A hardware, software, or network error may cause a computer to fail or hang during an ongoing transaction.
  • Transaction error – This error happens when user aborts the transaction, or logical programming error, or some operations like division by zero, etc.
  • External causes, exception conditions – A transaction may be failed if necessary data not found, or an exception condition met. For example, customer A tries to purchase an item online. Assume that only two such items are available when A starts his transaction and both of them purchased by other customers. When A reaches end of the transaction, the items are not available hence the transaction is cancelled or failed.

  • Concurrency control enforcement – If a transaction causes deadlock or violates serializability, then concurrency control schemes will force the transaction to abort.
  • Disk failure - Some disk blocks may lose their data because of a read or write malfunction or because of a disk read/write head crash. This may happen during a read or a write operation of the transaction.

The failures that are caused because of computer failure, transaction error, external causes, or concurrency control enforcement can be recovered if sufficient data is maintained (for example, transaction logs in log based recovery). These failures are some of the reasons that states the need of recovery subsystem in DBMS.
The failure that is caused by disk failure can be handled differently. For example, if we maintain a backup disk, the data can be restored.



********************


Go back to Transaction Management in DBMS home page






List and discuss the type of failures that causes a transaction fail


Saturday, April 2, 2016

Transaction Management in Database Management Systems

Transaction Management in Database Management Systems, Transaction Processing Concepts in DBMS, Transactions in DBMS, Serializability, Concurrency Control, Recovery in Database


Transactions Management in DBMS




  • View Serializability
  • Cascadeless Schedules

Advantages of Concurrent Execution of Transactions in Database

Advantages of Concurrent Execution of Transaction in Database, Advantages of concurrent execution in DBMS, Benefits of concurrent execution


Advantages of Concurrent Execution of Transactions


Executing multiple transactions simultaneously is called concurrent executions. This has to be done with extra care because of the complications that would arise in some cases. Though executing transactions serially may involve consistency, safety and like features, we cannot compromise time on serial execution. We need to implement the concept of concurrent execution of transactions much more in a multi-user systems. This gives the following advantages;

  • Improved throughput 
    • Number of transactions that can be executed in a given amount of time is called as throughput. When we execute multiple transactions simultaneously that increases the transaction throughput.
  • Resource utilization 
    • It is about using various system resources like disks and CPUs concurrently. We all know that most of the times these resources are not utilized properly. When a transaction is using CPU we may permit other transaction to use disk I/O to fetch the data from disks to main memory. This way the utilization of resources can be increased.
  • Reduced waiting time 
    • Concurrent execution of transactions would reduce the waiting time of other transactions. Consider a situation where all transactions are executed serially. Transactions may be of any size. When executing serially, one long transaction is executing and a very small transaction may be on the queue for its turn. This increases the waiting time of small transaction. Hence, if we execute transactions simultaneously, the waiting time would be much reduced when compared to the serial execution.
  • Average response time of transaction increased 
    • The average time consumed by a transaction to complete since its start is called as the average response time. In concurrent execution, as multiple transactions are executing simultaneously by sharing the system resources, the waiting time is reduced which in turn increases the average response time.

But, concurrent execution of transactions has to happen safely. There are variety of concurrency control schemes to do this without violating ACID properties.

********************
 
Go back to Transactions Management in DBMS home page




Monday, March 28, 2016

Transactions in Database Management Systems - Definition

Transactions in DBMS, Define transaction in database, Explain database transactions with example


Transactions


Transaction is a logical unit of work carried out by a single execution (of a program or an application) that reads or writes (updates/changes) the contents’ (one or more data items) values of the database.

Discussion:
Example 1

Assume that you have a savings account with account number ‘A101’ and you want to check your latest account balance. Here,

Data Item(s): Your account with account number ‘A101’ is the data item.
Operation (Read/Write): You want to access your balance. That means you like to read the balance.
Program/Application: You may use, for example, the ATM machine interface. That is the application/program which does read your balance from database.

Example 2

Assume that you want to transfer money from your account ‘A101’ to your friend’s account ‘A345’. Here,

Data Item(s): Your account with account number ‘A101’ is one data item. Your friend’s account ‘A345’ is another data item.
Operation (Read/Write): You want to transfer fund from your account to others. This action reduces your balance and increases your friend’s. This means you have to write new balances in both data items.
Program/Application: You may use, for example, the internet banking facility. Here, internet banking is the application/program which does change (write) your balances in the database.

Other definitions:

A transaction is a unit of program execution that accesses and possibly updates various data items – Silberschatz, Korth, Sudarshan - Database System Concepts.

A transaction symbolizes a unit of work performed within a database management system (or similar system) against a database, and treated in a coherent and reliable way independent of other transactions. A transaction generally represents any change in database - Wikipedia.

A transaction is an executing program that forms a logical unit of database processing. A transaction includes one or more database access operations—these can include insertion, deletion, modification, or retrieval operations - Ramez Elmasri, Shamkant B. Navathe - Fundamentals of Database Systems.

A transaction is defined as any one execution of a user program in a DBMS. A transaction is seen by the DBMS as a series, or list, of actions. The actions that can be executed by a transaction include reads and writes of database objects. A transaction can also be defined as a set of actions that are partially ordered. That is, the relative order of some of the actions may not be important – Raghu Ramakrishnan, Johannes Gehrke – Database Management Systems.



********************

Go back to Transactions Management in DBMS home page















Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents

data recovery