Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/TransactionManager.cs @ 4796

Last change on this file since 4796 was 4796, checked in by cneumuel, 14 years ago

#1233 applied new cloning mechanism

File size: 839 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using HeuristicLab.Services.Hive.Common;
6using System.Transactions;
7using HeuristicLab.Common;
8
9namespace HeuristicLab.Services.Hive.DataAccess {
10  public class TransactionManager {
11    public Disposable<TransactionScope> OpenTransaction() {
12      TransactionScope transaction = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = ApplicationConstants.IsolationLevelScope });
13      var disposable = new Disposable<TransactionScope>(transaction);
14      disposable.Disposing += disposable_Disposing;
15      return disposable;
16    }
17
18    void disposable_Disposing(object sender, EventArgs<TransactionScope> scope) {
19      scope.Value.Complete();
20      scope.Value.Dispose();
21    }
22  }
23}
Note: See TracBrowser for help on using the repository browser.