Last change
on this file since 4649 was
4649,
checked in by cneumuel, 13 years ago
|
- moved db-context into datalayer
- businesslayer only defines the transaction-scope
- removed contextfactory
- implemented convert-methods
- made naming in db and domainobjects more consistent
- changed wcf-service to be http-only (for now)
(#1233)
|
File size:
841 bytes
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using HeuristicLab.Services.Hive.Common;
|
---|
6 | using System.Transactions;
|
---|
7 | using HeuristicLab.Common;
|
---|
8 |
|
---|
9 | namespace HeuristicLab.Services.Hive.DataAccess {
|
---|
10 | public class TransactionManager {
|
---|
11 | public Disposable<TransactionScope> OpenTransaction() {
|
---|
12 | TransactionScope transaction = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = ApplicationConstants.ISOLATION_LEVEL_SCOPE });
|
---|
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.