From 5116767ec76f160a1e37c159ae896af1800b3ef8 Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Wed, 3 Jan 2018 13:00:08 +0100 Subject: [PATCH] Results.DB change : SessionFactory erased only when the new connection string differs from the previous one. --- Results/DB.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Results/DB.cs b/Results/DB.cs index 597ec6d4c..88b72a71c 100644 --- a/Results/DB.cs +++ b/Results/DB.cs @@ -21,12 +21,19 @@ namespace Results public static ISessionFactory SessionFactory; /// Connection string for all sessions - private static string connectionString; + static string connectionString; /// public static string ConnectionString { get { return connectionString; } - set { connectionString = value; SessionFactory = null; } + set + { + if (value != connectionString) + { + connectionString = value; + SessionFactory = null; /// Clear SessionFactory on connection string change + } + } } /// Database type (MySQL or SQLite) for all sessions