diff --git a/src/NServiceBus.NHibernate.Tests/App.config b/src/NServiceBus.NHibernate.Tests/App.config
deleted file mode 100644
index 4a3cdb1b9..000000000
--- a/src/NServiceBus.NHibernate.Tests/App.config
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/NServiceBus.NHibernate.Tests/NServiceBus.NHibernate.Tests.csproj b/src/NServiceBus.NHibernate.Tests/NServiceBus.NHibernate.Tests.csproj
index e7dd4915b..4c8199932 100644
--- a/src/NServiceBus.NHibernate.Tests/NServiceBus.NHibernate.Tests.csproj
+++ b/src/NServiceBus.NHibernate.Tests/NServiceBus.NHibernate.Tests.csproj
@@ -94,7 +94,6 @@
-
@@ -102,7 +101,6 @@
-
@@ -110,11 +108,11 @@
PreserveNewest
+ Designer
-
PreserveNewest
diff --git a/src/NServiceBus.NHibernate.Tests/Persistence/NHibernateProperties.cs b/src/NServiceBus.NHibernate.Tests/Persistence/NHibernateProperties.cs
index 551a5b706..f208211ea 100644
--- a/src/NServiceBus.NHibernate.Tests/Persistence/NHibernateProperties.cs
+++ b/src/NServiceBus.NHibernate.Tests/Persistence/NHibernateProperties.cs
@@ -142,7 +142,7 @@ public void Should_read_settings_from_hibernate_configuration_config_section_if_
var expected = new Dictionary
{
- {"connection.connection_string", @"Testing"},
+ {"connection.connection_string", @"Data Source=:memory:;New=True;"},
};
CollectionAssert.IsSubsetOf(expected, result);
@@ -164,7 +164,7 @@ public void Should_read_settings_from_hibernate_cfg_xml_if_available()
var expected = new Dictionary
{
- {"connection.connection_string", @"Testing2"},
+ {"connection.connection_string", @"Server=localhost\sqlexpress;Database=nservicebus;Trusted_Connection=True;"},
};
CollectionAssert.IsSubsetOf(expected, result);
diff --git a/src/NServiceBus.NHibernate.Tests/SagaPersister/InMemoryFixture.cs b/src/NServiceBus.NHibernate.Tests/SagaPersister/InMemoryFixture.cs
index c2ced75ca..9e7c421e2 100644
--- a/src/NServiceBus.NHibernate.Tests/SagaPersister/InMemoryFixture.cs
+++ b/src/NServiceBus.NHibernate.Tests/SagaPersister/InMemoryFixture.cs
@@ -24,7 +24,7 @@ public class InMemoryFixture
[SetUp]
public void SetUp()
{
- var connectionString = String.Format(@"Data Source={0};Version=3;New=True;", Path.GetTempFileName());
+ var connectionString = String.Format(@"Data Source={0};New=True;", Path.GetTempFileName());
Configure.ConfigurationSource = new FakeConfigurationSource();
diff --git a/src/NServiceBus.NHibernate.Tests/SagaPersister/SQLiteConfiguration.cs b/src/NServiceBus.NHibernate.Tests/SagaPersister/SQLiteConfiguration.cs
index 0cb4b31ca..4cc21f0ce 100644
--- a/src/NServiceBus.NHibernate.Tests/SagaPersister/SQLiteConfiguration.cs
+++ b/src/NServiceBus.NHibernate.Tests/SagaPersister/SQLiteConfiguration.cs
@@ -16,7 +16,7 @@ public static IDictionary InMemory()
var cfg = Base();
cfg.Add(Environment.ReleaseConnections, "on_close");
- cfg.Add(Environment.ConnectionString, "Data Source=:memory:;Version=3;New=True;");
+ cfg.Add(Environment.ConnectionString, "Data Source=:memory:;New=True;");
return cfg;
}
@@ -28,7 +28,7 @@ public static IDictionary UsingFile(string filename)
{
var cfg = Base();
- cfg.Add(Environment.ConnectionString, string.Format(@"Data Source={0};Version=3;New=True;", filename));
+ cfg.Add(Environment.ConnectionString, string.Format(@"Data Source={0};New=True;", filename));
return cfg;
}
diff --git a/src/NServiceBus.NHibernate.Tests/SubscriptionStorage/EnsuringBackwardsCompatability.cs b/src/NServiceBus.NHibernate.Tests/SubscriptionStorage/EnsuringBackwardsCompatability.cs
deleted file mode 100644
index 26174d2d5..000000000
--- a/src/NServiceBus.NHibernate.Tests/SubscriptionStorage/EnsuringBackwardsCompatability.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-namespace NServiceBus.Unicast.Subscriptions.NHibernate.Tests
-{
- using System;
- using System.Collections.Generic;
- using System.Collections.Specialized;
- using System.Configuration;
- using System.Linq;
- using NServiceBus.Config;
- using NServiceBus.Config.ConfigurationSource;
- using NUnit.Framework;
- using Persistence.NHibernate;
-
- [TestFixture]
- public class EnsuringBackwardsCompatibility
- {
- private const string connectionString = @"Data Source=.\database.sqlite;Version=3;New=True;";
- private const string dialect = "NHibernate.Dialect.SQLiteDialect";
-
- [SetUp]
- public void Setup()
- {
- NHibernateSettingRetriever.AppSettings = () => null;
- NHibernateSettingRetriever.ConnectionStrings = () => null;
- }
-
- [Test]
- public void UseNHibernateSubscriptionPersister_Reads_From_AppSettings_And_ConnectionStrings()
- {
- NHibernateSettingRetriever.AppSettings = () => new NameValueCollection
- {
- {
- "NServiceBus/Persistence/NHibernate/dialect",
- dialect
- }
- };
-
- NHibernateSettingRetriever.ConnectionStrings = () => new ConnectionStringSettingsCollection
- {
- new ConnectionStringSettings(
- "NServiceBus/Persistence/NHibernate",
- connectionString)
- };
-
- ConfigureNHibernate.Init();
-
- Configure.With(Enumerable.Empty())
- .DefineEndpointName("Foo")
- .DefaultBuilder()
- .UseNHibernateSubscriptionPersister();
-
- var expected = new Dictionary
- {
- {"dialect", dialect},
- {"connection.connection_string", connectionString},
- };
-
- CollectionAssert.IsSubsetOf(expected, ConfigureNHibernate.SubscriptionStorageProperties);
- }
-
-#pragma warning disable 0618
- [Test]
- public void DBSubscriptionStorageWithSQLiteAndAutomaticSchemaGeneration_Automatically_Configure_SqlLite()
- {
- ConfigureNHibernate.Init();
-
- Configure.With(Enumerable.Empty())
- .DefineEndpointName("Foo")
- .DefaultBuilder()
- .UseNHibernateSubscriptionPersister();
-
- var expected = new Dictionary
- {
- {"dialect", dialect},
- {"connection.connection_string", "Data Source=.\\NServiceBus.Subscriptions.sqlite;Version=3;New=True;"},
- };
-
- CollectionAssert.IsSubsetOf(expected, ConfigureNHibernate.SubscriptionStorageProperties);
- }
-#pragma warning restore 0618
-
- [Test]
- public void UseNHibernateSubscriptionPersister_Reads_From_DBSubscriptionStorageConfig()
- {
- Configure.ConfigurationSource = new FakeConfigurationSource();
-
- Configure.With(Enumerable.Empty())
- .DefineEndpointName("Foo")
- .DefaultBuilder()
- .UseNHibernateSubscriptionPersister();
-
- var expected = new Dictionary
- {
- {"dialect", dialect},
- {"connection.connection_string", connectionString},
- };
-
- CollectionAssert.IsSubsetOf(expected, ConfigureNHibernate.SubscriptionStorageProperties);
- }
-
- [Test]
- public void UseNHibernateSubscriptionPersister_Reads_First_From_DBSubscriptionStorageConfig()
- {
- NHibernateSettingRetriever.AppSettings = () => new NameValueCollection
- {
- {
- "NServiceBus/Persistence/NHibernate/dialect",
- "Shouldn't be this"
- }
- };
-
- NHibernateSettingRetriever.ConnectionStrings = () => new ConnectionStringSettingsCollection
- {
- new ConnectionStringSettings(
- "NServiceBus/Persistence/NHibernate",
- "Shouldn't be this")
- };
- ConfigureNHibernate.Init();
-
- Configure.ConfigurationSource = new FakeConfigurationSource();
-
- Configure.With(Enumerable.Empty())
- .DefineEndpointName("Foo")
- .DefaultBuilder()
- .UseNHibernateSubscriptionPersister();
-
- var expected = new Dictionary
- {
- {"dialect", dialect},
- {"connection.connection_string", connectionString},
- };
-
- CollectionAssert.IsSubsetOf(expected, ConfigureNHibernate.SubscriptionStorageProperties);
- }
-
- class FakeConfigurationSource : IConfigurationSource
- {
- public T GetConfiguration() where T : class, new()
- {
- var config = new DBSubscriptionStorageConfig
- {
- UpdateSchema = false,
- NHibernateProperties = new FakeNHibernatePropertyCollection(),
- };
-
-
- return config as T;
- }
- }
-
- sealed class FakeNHibernatePropertyCollection : NHibernatePropertyCollection
- {
- public FakeNHibernatePropertyCollection()
- {
- BaseAdd(new NHibernateProperty {Key = "dialect", Value = dialect});
- BaseAdd(new NHibernateProperty {Key = "connection.connection_string", Value = connectionString});
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/NServiceBus.NHibernate.Tests/Testing.config b/src/NServiceBus.NHibernate.Tests/Testing.config
index ed625fbfb..aa2740697 100644
--- a/src/NServiceBus.NHibernate.Tests/Testing.config
+++ b/src/NServiceBus.NHibernate.Tests/Testing.config
@@ -8,7 +8,7 @@
NHibernate.Connection.DriverConnectionProvider
NHibernate.Driver.SQLite20Driver
- Testing
+ Data Source=:memory:;New=True;
NHibernate.Dialect.SQLiteDialect
diff --git a/src/NServiceBus.NHibernate.Tests/TimeoutPersister/EnsuringBackwardsCompatability.cs b/src/NServiceBus.NHibernate.Tests/TimeoutPersister/EnsuringBackwardsCompatability.cs
deleted file mode 100644
index 136c04efa..000000000
--- a/src/NServiceBus.NHibernate.Tests/TimeoutPersister/EnsuringBackwardsCompatability.cs
+++ /dev/null
@@ -1,163 +0,0 @@
-namespace NServiceBus.TimeoutPersisters.NHibernate.Tests
-{
- using System;
- using System.Collections.Generic;
- using System.Collections.Specialized;
- using System.Configuration;
- using System.Linq;
- using NServiceBus.Config;
- using NServiceBus.Config.ConfigurationSource;
- using NUnit.Framework;
- using Persistence.NHibernate;
-
- [TestFixture]
- public class EnsuringBackwardsCompatibility
- {
- private const string connectionString = @"Data Source=.\database.sqlite;Version=3;New=True;";
- private const string dialect = "NHibernate.Dialect.SQLiteDialect";
-
- [SetUp]
- public void Setup()
- {
- NHibernateSettingRetriever.AppSettings = () => null;
- NHibernateSettingRetriever.ConnectionStrings = () => null;
-
- Configure.ConfigurationSource = new DefaultConfigurationSource();
- }
-
- [Test]
- public void UseNHibernateTimeoutPersister_Reads_From_AppSettings_And_ConnectionStrings()
- {
- NHibernateSettingRetriever.AppSettings = () => new NameValueCollection
- {
- {
- "NServiceBus/Persistence/NHibernate/dialect",
- dialect
- }
- };
-
- NHibernateSettingRetriever.ConnectionStrings = () => new ConnectionStringSettingsCollection
- {
- new ConnectionStringSettings(
- "NServiceBus/Persistence",
- connectionString)
- };
-
- ConfigureNHibernate.Init();
-
- Configure.With(Enumerable.Empty())
- .DefineEndpointName("Foo")
- .DefaultBuilder()
- .UseNHibernateTimeoutPersister();
-
- var expected = new Dictionary
- {
- {"dialect", dialect},
- {"connection.connection_string", connectionString},
- };
-
- CollectionAssert.IsSubsetOf(expected, ConfigureNHibernate.TimeoutPersisterProperties);
- }
-
-#pragma warning disable 0618
- [Test]
- public void UseNHibernateTimeoutPersisterWithSQLiteAndAutomaticSchemaGeneration_Automatically_Configure_SqlLite()
- {
- ConfigureNHibernate.Init();
-
- Configure.With(Enumerable.Empty())
- .DefineEndpointName("Foo")
- .DefaultBuilder()
- .UseNHibernateTimeoutPersister();
-
- var expected = new Dictionary
- {
- {"dialect", dialect},
- {"connection.connection_string", "Data Source=.\\NServiceBus.Timeouts.sqlite;Version=3;New=True;"},
- };
-
- CollectionAssert.IsSubsetOf(expected, ConfigureNHibernate.TimeoutPersisterProperties);
- }
-#pragma warning restore 0618
-
- [Test]
- public void UseNHibernateTimeoutPersister_Reads_From_TimeoutPersisterConfig()
- {
- Configure.ConfigurationSource = new FakeConfigurationSource();
-
- ConfigureNHibernate.Init();
-
- Configure.With(Enumerable.Empty())
- .DefineEndpointName("Foo")
- .DefaultBuilder()
- .UseNHibernateTimeoutPersister();
-
- var expected = new Dictionary
- {
- {"dialect", dialect},
- {"connection.connection_string", connectionString},
- };
-
- CollectionAssert.IsSubsetOf(expected, ConfigureNHibernate.TimeoutPersisterProperties);
- }
-
- [Test]
- public void UseNHibernateTimeoutPersister_Reads_First_From_TimeoutPersisterConfig()
- {
- NHibernateSettingRetriever.AppSettings = () => new NameValueCollection
- {
- {
- "NServiceBus/Persistence/NHibernate/dialect",
- "Shouldn't be this"
- }
- };
-
- NHibernateSettingRetriever.ConnectionStrings = () => new ConnectionStringSettingsCollection
- {
- new ConnectionStringSettings(
- "NServiceBus/Persistence",
- "Shouldn't be this")
- };
- ConfigureNHibernate.Init();
-
- Configure.ConfigurationSource = new FakeConfigurationSource();
-
- Configure.With(Enumerable.Empty())
- .DefineEndpointName("Foo")
- .DefaultBuilder()
- .UseNHibernateTimeoutPersister();
-
- var expected = new Dictionary
- {
- {"dialect", dialect},
- {"connection.connection_string", connectionString},
- };
-
- CollectionAssert.IsSubsetOf(expected, ConfigureNHibernate.TimeoutPersisterProperties);
- }
-
- class FakeConfigurationSource : IConfigurationSource
- {
- public T GetConfiguration() where T : class, new()
- {
- var config = new TimeoutPersisterConfig
- {
- UpdateSchema = false,
- NHibernateProperties = new FakeNHibernatePropertyCollection(),
- };
-
-
- return config as T;
- }
- }
-
- sealed class FakeNHibernatePropertyCollection : NHibernatePropertyCollection
- {
- public FakeNHibernatePropertyCollection()
- {
- BaseAdd(new NHibernateProperty {Key = "dialect", Value = dialect});
- BaseAdd(new NHibernateProperty {Key = "connection.connection_string", Value = connectionString});
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/NServiceBus.NHibernate.Tests/hibernate.cfg.xml b/src/NServiceBus.NHibernate.Tests/hibernate.cfg.xml
index 567127c01..076368b88 100644
--- a/src/NServiceBus.NHibernate.Tests/hibernate.cfg.xml
+++ b/src/NServiceBus.NHibernate.Tests/hibernate.cfg.xml
@@ -1,6 +1,6 @@
- Testing2
+ Server=localhost\sqlexpress;Database=nservicebus;Trusted_Connection=True;
diff --git a/src/NServiceBus.NHibernate/Config/DBSubscriptionStorageConfig.cs b/src/NServiceBus.NHibernate/Config/DBSubscriptionStorageConfig.cs
deleted file mode 100644
index e9b805afc..000000000
--- a/src/NServiceBus.NHibernate/Config/DBSubscriptionStorageConfig.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-namespace NServiceBus.Config
-{
- using System.Configuration;
-
- public class DBSubscriptionStorageConfig : ConfigurationSection
- {
- [ConfigurationProperty("NHibernateProperties", IsRequired = false)]
- public NHibernatePropertyCollection NHibernateProperties
- {
- get
- {
- return this["NHibernateProperties"] as NHibernatePropertyCollection;
- }
- set
- {
- this["NHibernateProperties"] = value;
- }
- }
-
- [ConfigurationProperty("UpdateSchema", IsRequired = false, DefaultValue = true)]
- public bool UpdateSchema
- {
-
- get
- {
-
- return (bool)this["UpdateSchema"];
- }
- set
- {
- this["UpdateSchema"] = value;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/NServiceBus.NHibernate/Config/NHibernateProperty.cs b/src/NServiceBus.NHibernate/Config/NHibernateProperty.cs
deleted file mode 100644
index 7ef8b1e23..000000000
--- a/src/NServiceBus.NHibernate/Config/NHibernateProperty.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-namespace NServiceBus.Config
-{
- using System.Configuration;
-
- ///
- /// A NHibernate property
- ///
- public class NHibernateProperty : ConfigurationElement
- {
- ///
- /// The key
- ///
- [ConfigurationProperty("Key", IsRequired = true, IsKey = true)]
- public string Key
- {
- get
- {
- return (string)this["Key"];
- }
- set
- {
- this["Key"] = value;
- }
- }
-
- ///
- /// The value to use
- ///
- [ConfigurationProperty("Value", IsRequired = true, IsKey = false)]
- public string Value
- {
- get
- {
- return (string)this["Value"];
- }
- set
- {
- this["Value"] = value;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/NServiceBus.NHibernate/Config/NHibernatePropertyCollection.cs b/src/NServiceBus.NHibernate/Config/NHibernatePropertyCollection.cs
deleted file mode 100644
index 38ea266d1..000000000
--- a/src/NServiceBus.NHibernate/Config/NHibernatePropertyCollection.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-namespace NServiceBus.Config
-{
- using System.Collections.Generic;
- using System.Configuration;
-
- ///
- /// Collection of NHibernate properties
- ///
- public class NHibernatePropertyCollection: ConfigurationElementCollection
- {
- ///
- /// Creates a new empty property
- ///
- protected override ConfigurationElement CreateNewElement()
- {
- return new NHibernateProperty();
- }
-
- ///
- /// Returns the key for the given element
- ///
- protected override object GetElementKey(ConfigurationElement element)
- {
- return ((NHibernateProperty)element).Key;
- }
-
- ///
- /// Converts the collection to a dictionary
- ///
- public IDictionary ToProperties()
- {
- var returnValue = new Dictionary();
-
- foreach(var element in this)
- {
-
- returnValue.Add(
- (element as NHibernateProperty).Key,
- (element as NHibernateProperty).Value);
- }
-
- return returnValue;
- }
- }
-}
\ No newline at end of file
diff --git a/src/NServiceBus.NHibernate/Config/NHibernateSagaPersisterConfig.cs b/src/NServiceBus.NHibernate/Config/NHibernateSagaPersisterConfig.cs
deleted file mode 100644
index 708e0e8e4..000000000
--- a/src/NServiceBus.NHibernate/Config/NHibernateSagaPersisterConfig.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-namespace NServiceBus.Config
-{
- using System.Configuration;
-
- ///
- /// Config section for the NHibernate Saga Persister
- ///
- public class NHibernateSagaPersisterConfig:ConfigurationSection
- {
- ///
- /// Collection of NHibernate properties to set
- ///
- [ConfigurationProperty("NHibernateProperties", IsRequired = false)]
- public NHibernatePropertyCollection NHibernateProperties
- {
- get
- {
- return this["NHibernateProperties"] as NHibernatePropertyCollection;
- }
- set
- {
- this["NHibernateProperties"] = value;
- }
- }
-
- ///
- /// ´Determines if the database should be auto updated
- ///
- [ConfigurationProperty("UpdateSchema", IsRequired = false, DefaultValue = true)]
- public bool UpdateSchema
- {
-
- get
- {
-
- return (bool)this["UpdateSchema"];
- }
- set
- {
- this["UpdateSchema"] = value;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/NServiceBus.NHibernate/Config/TimeoutPersisterConfig.cs b/src/NServiceBus.NHibernate/Config/TimeoutPersisterConfig.cs
deleted file mode 100644
index 0dda961f6..000000000
--- a/src/NServiceBus.NHibernate/Config/TimeoutPersisterConfig.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-namespace NServiceBus.Config
-{
- using System.Configuration;
-
- ///
- /// Represents the configuration section for Timeout Persister.
- ///
- public class TimeoutPersisterConfig : ConfigurationSection
- {
- ///
- /// Collection of NHibernate properties.
- ///
- [ConfigurationProperty("NHibernateProperties", IsRequired = false)]
- public NHibernatePropertyCollection NHibernateProperties
- {
- get
- {
- return this["NHibernateProperties"] as NHibernatePropertyCollection;
- }
- set
- {
- this["NHibernateProperties"] = value;
- }
- }
-
- ///
- /// true to update database schema.
- ///
- [ConfigurationProperty("UpdateSchema", IsRequired = false,DefaultValue = true)]
- public bool UpdateSchema
- {
-
- get
- {
-
- return (bool)this["UpdateSchema"];
- }
- set
- {
- this["UpdateSchema"] = value;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/NServiceBus.NHibernate/ConfigureNHibernateSagaPersister.cs b/src/NServiceBus.NHibernate/ConfigureNHibernateSagaPersister.cs
index 21ff5ddf4..1df42914f 100644
--- a/src/NServiceBus.NHibernate/ConfigureNHibernateSagaPersister.cs
+++ b/src/NServiceBus.NHibernate/ConfigureNHibernateSagaPersister.cs
@@ -2,7 +2,6 @@
{
using System;
using System.Collections.Generic;
- using Config;
// ReSharper disable RedundantNameQualifier
using global::NHibernate;
using global::NHibernate.Cfg;
@@ -79,27 +78,11 @@ public static Configure UseNHibernateSagaPersister(this Configure config)
/// The configuration object.
public static Configure UseNHibernateSagaPersister(this Configure config, Func tableNamingConvention)
{
- var configSection = Configure.GetConfigSection();
-
- if (configSection != null)
- {
- if (configSection.NHibernateProperties.Count == 0)
- {
- throw new InvalidOperationException(
- "No NHibernate properties found. Please specify NHibernateProperties in your NHibernateSagaPersisterConfig section");
- }
-
- foreach (var property in configSection.NHibernateProperties.ToProperties())
- {
- ConfigureNHibernate.SagaPersisterProperties[property.Key] = property.Value;
- }
- }
-
ConfigureNHibernate.ConfigureSqlLiteIfRunningInDebugModeAndNoConfigPropertiesSet(ConfigureNHibernate.SagaPersisterProperties);
var properties = ConfigureNHibernate.SagaPersisterProperties;
- return config.UseNHibernateSagaPersisterInternal(ConfigureNHibernate.CreateConfigurationWith(properties), configSection == null || configSection.UpdateSchema, tableNamingConvention);
+ return config.UseNHibernateSagaPersisterInternal(ConfigureNHibernate.CreateConfigurationWith(properties), true, tableNamingConvention);
}
///
diff --git a/src/NServiceBus.NHibernate/ConfigureNHibernateSubscriptionStorage.cs b/src/NServiceBus.NHibernate/ConfigureNHibernateSubscriptionStorage.cs
index 8ec410d80..686e01345 100644
--- a/src/NServiceBus.NHibernate/ConfigureNHibernateSubscriptionStorage.cs
+++ b/src/NServiceBus.NHibernate/ConfigureNHibernateSubscriptionStorage.cs
@@ -1,7 +1,6 @@
namespace NServiceBus
{
using System;
- using Config;
// ReSharper disable RedundantNameQualifier
using global::NHibernate;
using global::NHibernate.Cfg;
@@ -78,28 +77,12 @@ public static Configure UseNHibernateSubscriptionPersister(this Configure config
/// The configuration object.
public static Configure UseNHibernateSubscriptionPersister(this Configure config, TimeSpan? cacheExpiration)
{
- var configSection = Configure.GetConfigSection();
-
- if (configSection != null)
- {
- if (configSection.NHibernateProperties.Count == 0)
- {
- throw new InvalidOperationException(
- "No NHibernate properties found. Please specify NHibernateProperties in your DBSubscriptionStorageConfig section");
- }
-
- foreach (var property in configSection.NHibernateProperties.ToProperties())
- {
- ConfigureNHibernate.SubscriptionStorageProperties[property.Key] = property.Value;
- }
- }
-
ConfigureNHibernate.ConfigureSqlLiteIfRunningInDebugModeAndNoConfigPropertiesSet(ConfigureNHibernate.SubscriptionStorageProperties);
var properties = ConfigureNHibernate.SubscriptionStorageProperties;
return config.UseNHibernateSubscriptionPersisterInternal(ConfigureNHibernate.CreateConfigurationWith(properties),
- configSection == null || configSection.UpdateSchema, cacheExpiration);
+ true, cacheExpiration);
}
///
@@ -203,7 +186,7 @@ public static Configure DBSubcriptionStorage(this Configure config, Configuratio
///
/// Configures DB Subscription Storage.
- /// Database settings are read from custom config section .
+ /// Database settings are read from custom config section.
///
/// The object.
/// The object.
diff --git a/src/NServiceBus.NHibernate/ConfigureNHibernateTimeoutPersister.cs b/src/NServiceBus.NHibernate/ConfigureNHibernateTimeoutPersister.cs
index 00e88da0c..7a3036167 100644
--- a/src/NServiceBus.NHibernate/ConfigureNHibernateTimeoutPersister.cs
+++ b/src/NServiceBus.NHibernate/ConfigureNHibernateTimeoutPersister.cs
@@ -1,7 +1,5 @@
namespace NServiceBus
{
- using System;
- using Config;
// ReSharper disable once RedundantNameQualifier
using global::NHibernate.Cfg;
using Persistence.NHibernate;
@@ -42,28 +40,11 @@ public static class ConfigureNHibernateTimeoutPersister
/// The configuration object.
public static Configure UseNHibernateTimeoutPersister(this Configure config)
{
- var configSection = Configure.GetConfigSection();
-
- if (configSection != null)
- {
- if (configSection.NHibernateProperties.Count == 0)
- {
- throw new InvalidOperationException(
- "No NHibernate properties found. Please specify NHibernateProperties in your TimeoutPersisterConfig section");
- }
-
- foreach (var property in configSection.NHibernateProperties.ToProperties())
- {
- ConfigureNHibernate.TimeoutPersisterProperties[property.Key] = property.Value;
- }
- }
-
ConfigureNHibernate.ConfigureSqlLiteIfRunningInDebugModeAndNoConfigPropertiesSet(ConfigureNHibernate.TimeoutPersisterProperties);
var properties = ConfigureNHibernate.TimeoutPersisterProperties;
- return config.UseNHibernateTimeoutPersisterInternal(ConfigureNHibernate.CreateConfigurationWith(properties),
- configSection == null || configSection.UpdateSchema);
+ return config.UseNHibernateTimeoutPersisterInternal(ConfigureNHibernate.CreateConfigurationWith(properties), true);
}
///
diff --git a/src/NServiceBus.NHibernate/NServiceBus.NHibernate.csproj b/src/NServiceBus.NHibernate/NServiceBus.NHibernate.csproj
index 95b02131a..ba0223d42 100644
--- a/src/NServiceBus.NHibernate/NServiceBus.NHibernate.csproj
+++ b/src/NServiceBus.NHibernate/NServiceBus.NHibernate.csproj
@@ -83,11 +83,6 @@
-
-
-
-
-
diff --git a/src/NServiceBus.NHibernate/Persistence/ConfigureNHibernate.cs b/src/NServiceBus.NHibernate/Persistence/ConfigureNHibernate.cs
index 3a5a2ca60..d6770d809 100644
--- a/src/NServiceBus.NHibernate/Persistence/ConfigureNHibernate.cs
+++ b/src/NServiceBus.NHibernate/Persistence/ConfigureNHibernate.cs
@@ -189,7 +189,7 @@ public static void ConfigureSqlLiteIfRunningInDebugModeAndNoConfigPropertiesSet(
Logger.WarnFormat(warningMsg, GetConfigFileIfExists(), System.Environment.Is64BitOperatingSystem ? "x64" : "x86", Message);
properties.Add("dialect", "NHibernate.Dialect.SQLiteDialect");
- properties.Add("connection.connection_string", @"Data Source=.\NServiceBus.sqllite;Version=3;New=True;");
+ properties.Add("connection.connection_string", @"Data Source=.\NServiceBus.sqllite;New=True;");
}
///