Google News
logo
WCF - Interview Questions
Explain transactions in WCF?
A transaction is a logical unit of work consisting of multiple activities that must either succeed or fail together. For example, you are trying to make an online purchase for a dress; your amount is debited from the bank, but your ordered dress was not delivered to you. So what did you get from the preceding example? Bank operations hosted in a separate service and the online purchase service (Ordering the goods) hosted as another separate service. For the preceding example the online purchase service did not work well as expected due to the database query error, without knowing it the Bank operations were completed perfectly. For this we really need transactions to ensure that either of the operations should succeed or fail. Before we go to the WCF transactions, let us discuss what exactly are the basics behind the transactions.
 
The following are the types of the Transactions :
 
* Atomic
* Long Running

Phases of WCF Transaction
 
There are two phases in a WCF transaction :
 
Prepare Phase - In this phase, the transaction manager checks whether all the entities are ready to commit for the transaction or not.
Commit Phase - In this phase, the commitment of entities get started in reality.
Advertisement