From 444320e4a6b78a6df469ea1ecadd421de154a9fa Mon Sep 17 00:00:00 2001
From: Adam Johnson
Date: Sun, 25 Jan 2009 08:31:08 +0000
Subject: Applied patch from #3012 Fixing a minor bug where nhibernate mappings
from outside OpenSim.Data.NHibernate assembly were not included in
sessionFactory. Thanks mpallari!
---
OpenSim/Data/NHibernate/NHibernateManager.cs | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
(limited to 'OpenSim/Data')
diff --git a/OpenSim/Data/NHibernate/NHibernateManager.cs b/OpenSim/Data/NHibernate/NHibernateManager.cs
index 8fca6fe..5e5eb47 100644
--- a/OpenSim/Data/NHibernate/NHibernateManager.cs
+++ b/OpenSim/Data/NHibernate/NHibernateManager.cs
@@ -49,7 +49,7 @@ namespace OpenSim.Data.NHibernate
/// Parses the connection string and creates the NHibernate configuration
///
/// NHibernate dialect, driver and connection string separated by ';'
- private void parseConnectionString(string connect)
+ private void ParseConnectionString(string connect)
{
// Split out the dialect, driver, and connect string
char[] split = { ';' };
@@ -73,7 +73,6 @@ namespace OpenSim.Data.NHibernate
configuration.SetProperty(Environment.ConnectionString, parts[2]);
configuration.AddAssembly("OpenSim.Data.NHibernate");
- sessionFactory = configuration.BuildSessionFactory();
}
///
@@ -82,7 +81,7 @@ namespace OpenSim.Data.NHibernate
/// Dialect in use
/// Assembly where migration files exist
/// Name of the store in use
- private void runMigration(string dialect, Assembly assembly, string store)
+ private void RunMigration(string dialect, Assembly assembly, string store)
{
// Migration subtype is the folder name under which migrations are stored. For mysql this folder is
// MySQLDialect instead of MySQL5Dialect which is the dialect currently in use. To avoid renaming
@@ -104,7 +103,7 @@ namespace OpenSim.Data.NHibernate
/// Name of the store
public NHibernateManager(string connect, string store)
{
- parseConnectionString(connect);
+ ParseConnectionString(connect);
//To create sql file uncomment code below and write the name of the file
//SchemaExport exp = new SchemaExport(cfg);
@@ -113,7 +112,8 @@ namespace OpenSim.Data.NHibernate
Assembly assembly = GetType().Assembly;
- runMigration(dialect, assembly, store);
+ sessionFactory = configuration.BuildSessionFactory();
+ RunMigration(dialect, assembly, store);
}
///
@@ -121,14 +121,14 @@ namespace OpenSim.Data.NHibernate
///
/// NHibernate dialect, driver and connection string separated by ';'
/// Name of the store
- ///
+ /// Outside assembly to be included
public NHibernateManager(string connect, string store, Assembly assembly)
{
- parseConnectionString(connect);
+ ParseConnectionString(connect);
configuration.AddAssembly(assembly);
-
- runMigration(dialect, assembly, store);
+ sessionFactory = configuration.BuildSessionFactory();
+ RunMigration(dialect, assembly, store);
}
public object Load(Type type, UUID uuid)
--
cgit v1.1