Last change
on this file since 3543 was
3220,
checked in by kgrading, 15 years ago
|
improved the DAL further, changed minor details for the presentation (#830)
|
File size:
853 bytes
|
Rev | Line | |
---|
[2904] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Linq;
|
---|
| 4 | using System.Text;
|
---|
[3220] | 5 | using System.Data.Common;
|
---|
| 6 | using System.Data.SqlClient;
|
---|
[2904] | 7 |
|
---|
| 8 | namespace HeuristicLab.Hive.Server.LINQDataAccess {
|
---|
| 9 | public class ContextFactory {
|
---|
| 10 | [ThreadStatic]
|
---|
| 11 | private static HiveDataContext _hiveDataContext;
|
---|
| 12 |
|
---|
[3220] | 13 | [ThreadStatic]
|
---|
| 14 | private static SqlTransaction _currentTransaction;
|
---|
| 15 |
|
---|
[2904] | 16 | public static HiveDataContext Context {
|
---|
| 17 | get {
|
---|
| 18 | if(_hiveDataContext == null)
|
---|
| 19 | _hiveDataContext = new HiveDataContext();
|
---|
| 20 | return _hiveDataContext;
|
---|
| 21 | }
|
---|
[3220] | 22 | set {
|
---|
[3011] | 23 | _hiveDataContext = value;
|
---|
| 24 | }
|
---|
[2904] | 25 | }
|
---|
[3220] | 26 |
|
---|
| 27 | public static SqlTransaction CurrentTransaction {
|
---|
| 28 | get {
|
---|
| 29 | return _currentTransaction;
|
---|
| 30 | } set {
|
---|
| 31 | _currentTransaction = value;
|
---|
| 32 | }
|
---|
| 33 | }
|
---|
[2904] | 34 | }
|
---|
| 35 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.