167k views
1 vote
What mechanisms are defined in SqlTransaction class to ensure the correctness of business transactions? Select all that apply.

a. Duplicate that executes the commands twice to ensure the operation succeed at least once.
b. Commit that executes the two database updates at the same time.
c. Rollback that restores the database to the state before the Commit operations.
d. Retry that restarts the database updates after a failure is detected.

User NiziL
by
7.9k points

1 Answer

5 votes

Final answer:

The SqlTransaction class ensures transaction correctness through the Commit mechanism, which applies changes as a single unit, and the Rollback mechanism, which reverts the database to a pre-transaction state if needed.

Step-by-step explanation:

The SqlTransaction class in database management systems like SQL Server provides mechanisms to ensure the correctness and consistency of data during business transactions. One important feature is the Commit, which applies all changes made during the transaction as a single unit, ensuring that either all changes succeed or none do, maintaining database integrity. Another mechanism is Rollback, which is used to undo changes if an error occurs or if the transaction cannot be completed, reverting the database to its previous state before the transaction began. Contrary to the options provided, there is no 'Duplicate' mechanism that executes the commands twice or a 'Retry' mechanism inherent in the SqlTransaction class. Proper use of commit and rollback operations ensures atomicity and consistency in transaction processing.

User MGE
by
7.9k points