Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/ContextFactory.cs @ 3578

Last change on this file since 3578 was 3578, checked in by kgrading, 14 years ago

Removed References to HiveLogging and updated the default logging mechanism (#991)

File size: 867 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Data.Common;
6using System.Data.SqlClient;
7
8namespace HeuristicLab.Hive.Server.LINQDataAccess {
9  public class ContextFactory {
10    [ThreadStatic]
11    private static HiveDataContext _hiveDataContext = null;
12
13    [ThreadStatic]
14    private static SqlTransaction _currentTransaction = null;
15
16    public static HiveDataContext Context {
17      get {
18        if(_hiveDataContext == null)
19          _hiveDataContext = new HiveDataContext();
20        return _hiveDataContext;       
21      }
22      set {       
23        _hiveDataContext = value;
24      }
25    }
26
27    public static SqlTransaction CurrentTransaction {
28      get {
29        return _currentTransaction;
30      } set {
31        _currentTransaction = value;
32      }
33    }
34  }
35}
Note: See TracBrowser for help on using the repository browser.