Last change
on this file since 3091 was
2846,
checked in by kgrading, 15 years ago
|
various improvements (#828) concerning the stability of the server
|
File size:
1017 bytes
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using HeuristicLab.PluginInfrastructure;
|
---|
6 | using HeuristicLab.DataAccess.Interfaces;
|
---|
7 | using System.Runtime.CompilerServices;
|
---|
8 | using System.Data.SqlClient;
|
---|
9 |
|
---|
10 | namespace HeuristicLab.Security.Core {
|
---|
11 | class ServiceLocator {
|
---|
12 | private static ISessionFactory sessionFactory = null;
|
---|
13 |
|
---|
14 | /// <summary>
|
---|
15 | /// Gets the db session factory
|
---|
16 | /// </summary>
|
---|
17 | /// <returns></returns>
|
---|
18 | [MethodImpl(MethodImplOptions.Synchronized)]
|
---|
19 | public static ISessionFactory GetSessionFactory() {
|
---|
20 | if (sessionFactory == null) {
|
---|
21 | sessionFactory =
|
---|
22 | ApplicationManager.Manager.GetInstances<ISessionFactory>().First();
|
---|
23 |
|
---|
24 | sessionFactory.DbConnectionType =
|
---|
25 | typeof(SqlConnection);
|
---|
26 |
|
---|
27 | sessionFactory.DbConnectionString =
|
---|
28 | HeuristicLab.Security.Core.Properties.Settings.Default.SecurityServerConnectionString;
|
---|
29 | }
|
---|
30 |
|
---|
31 | return sessionFactory;
|
---|
32 | }
|
---|
33 | }
|
---|
34 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.