PDA

View Full Version : Transactions TimeOut



25farshid
سه شنبه 18 بهمن 1390, 17:27 عصر
سلام
میخاستم بدونم آیا میشه Transactions TimeOut رو تغییر داد .
اگه میشه چه جوری؟
با تشکر.

25farshid
چهارشنبه 19 بهمن 1390, 10:34 صبح
برای تغییر دادن TransactionscTimeOut میتونیم این کد رو به فایل config اضافه کنیم.
<system.transactions>
<defaultSettings timeout="00:05:00"/>
</system.transactions>
اگه دوستان راه حل دیگه ای به نظرشون میرسه لطف کنن...

25farshid
چهارشنبه 19 بهمن 1390, 10:43 صبح
یه راه دیگش اینه که موقع تعریف کردن transactionsscop همون موقع پارامتر timeout رو مقدار دهی کنیم. به این شکل:
TimeSpan ts1 = new TimeSpan(6, 0, 0);
using (TransactionScope t = new TransactionScope(TransactionScopeOption.RequiresNe w, ts1))