Google News
logo
ADO.NET - Interview Questions
Explain the types of transactions available in ADO.NET
ADO.NET supports the following two types of transactions
 
Local transaction :
* A local transaction is a one-phase transaction that the database handles directly. For bringing out local transactions, every.NET Framework data provider has its own Transaction object.

* Importing a System, for example, allows us to make a transaction with a SQL Server database. System.Data.SqlClient Import the System if you want to run an Oracle transaction. System.Data.OracleClient For writing code that is not dependent on the provider and requires transactions, a DbTransaction class will be utilized.


Distributed transaction :
* A transaction monitor will coordinate a distributed transaction, which will use fail-safe procedures like a two-phase commit to resolve the transaction. Multiple resources will be impacted by this transaction.

* If a user may utilize a distributed transaction to perform a transaction across many data servers (Oracle, SQL Server, etc. ),

* If a distributed transaction is to commit, all parties must agree that any data changes made are permanent. Even if the system crashes or other unforeseeable circumstances occur, the changes must be preserved. Even if a single participant fails to fulfil this assurance, the transaction as a whole will fail, and all alterations to data within the transaction scope will be rolled back.
Advertisement