views:

238

answers:

1

I am testing whether option from app.config listed below Is applied to all transactions in the application.

<system.transactions>
   <defaultSettings timeout="00:05:00" />
</system.transactions>

Transaction are defined using transaction scope in following way

using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required))

Is it possible to find out what timeout has transaction created by transaction scope?

+1  A: 

You can do it using transactionoptions.timeout, see:

http://social.msdn.microsoft.com/Forums/en-US/windowstransactionsprogramming/thread/250b40b9-0838-4142-a8ff-d9d26690083b

EDIT

Transaction scope does not have any public properties, so you will not be able to get any information. You only have access to the timeout through the constructor.

http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx

Shiraz Bhaiji
Well the article say only how to SET timeout. Make sure that maxTimeOut configuration option does not override it. I want to check whether transaction has appropriate time out or not. I.E. I need to GET transaction timeout.
klashar