Thursday, April 21, 2005

Transactions In .NET XML Web Services

Few important points to remember when programing transactions using .NET XML Web Services .

Your class (the one that provides transactions) does not need to inherit from WebService class.

You dont need to explicity commit or rollback your transactions. It is done “automatically“ i.e. if your method doesnt throw any exception then transaction is committed otherwise it is rejected.

Since HTTP is stateless your web service transactions (e.g. your web methods) can only take part in transactions as root of transactions. This implies that your web method can not be part of an existing transaction and it will always start a new transaction. This holds true even if you set your TransactionOption enum to RequiresNew or Required.

No comments: