A Transaction ends

  1. Only when it is Committed

  2. Only when it is Rolledback

  3. When it is Committed or Rolledback

  4. None of the above


Correct Option: C
Explanation:

To answer this question, users need to understand the concept of transaction management in the database.

A transaction is a sequence of operations performed on a database that must be treated as a single unit of work. It has four main properties - Atomicity, Consistency, Isolation, and Durability. In case, a transaction is not committed, it is rolled back, which means all changes made by the transaction are undone.

Now, let's go through each option:

A. Only when it is Committed: This option is incorrect because a transaction can end in two ways: by committing or by rolling back. If the transaction is committed, the changes made by it are made permanent in the database.

B. Only when it is Rolledback: This option is incorrect because a transaction can end either by committing or by rolling back. If a transaction is rolled back, the changes made by it are undone, and the database is restored to its original state before the transaction began.

C. When it is Committed or Rolledback: This option is correct because a transaction can either be committed or rolled back. Once a transaction is committed or rolled back, it gets over, and the database moves to the next transaction.

D. None of the above: This option is incorrect because, as explained above, a transaction ends either by committing or by rolling back.

Hence, the correct answer is:

The Answer is: C. When it is Committed or Rolledback.

Find more quizzes: