aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorAdam Johnson2009-01-25 08:31:08 +0000
committerAdam Johnson2009-01-25 08:31:08 +0000
commit444320e4a6b78a6df469ea1ecadd421de154a9fa (patch)
treed6c4bd6cb85689fb9cb595aeca6453215c7ac6e3 /OpenSim
parent* Adds console command, 'predecode-j2k <number of threads>' to load all of th... (diff)
downloadopensim-SC_OLD-444320e4a6b78a6df469ea1ecadd421de154a9fa.zip
opensim-SC_OLD-444320e4a6b78a6df469ea1ecadd421de154a9fa.tar.gz
opensim-SC_OLD-444320e4a6b78a6df469ea1ecadd421de154a9fa.tar.bz2
opensim-SC_OLD-444320e4a6b78a6df469ea1ecadd421de154a9fa.tar.xz
Applied patch from #3012 Fixing a minor bug where nhibernate mappings from outside OpenSim.Data.NHibernate assembly were not included in sessionFactory. Thanks mpallari!
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Data/NHibernate/NHibernateManager.cs18
1 files changed, 9 insertions, 9 deletions
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
49 /// Parses the connection string and creates the NHibernate configuration 49 /// Parses the connection string and creates the NHibernate configuration
50 /// </summary> 50 /// </summary>
51 /// <param name="connect">NHibernate dialect, driver and connection string separated by ';'</param> 51 /// <param name="connect">NHibernate dialect, driver and connection string separated by ';'</param>
52 private void parseConnectionString(string connect) 52 private void ParseConnectionString(string connect)
53 { 53 {
54 // Split out the dialect, driver, and connect string 54 // Split out the dialect, driver, and connect string
55 char[] split = { ';' }; 55 char[] split = { ';' };
@@ -73,7 +73,6 @@ namespace OpenSim.Data.NHibernate
73 configuration.SetProperty(Environment.ConnectionString, parts[2]); 73 configuration.SetProperty(Environment.ConnectionString, parts[2]);
74 configuration.AddAssembly("OpenSim.Data.NHibernate"); 74 configuration.AddAssembly("OpenSim.Data.NHibernate");
75 75
76 sessionFactory = configuration.BuildSessionFactory();
77 } 76 }
78 77
79 /// <summary> 78 /// <summary>
@@ -82,7 +81,7 @@ namespace OpenSim.Data.NHibernate
82 /// <param name="dialect">Dialect in use</param> 81 /// <param name="dialect">Dialect in use</param>
83 /// <param name="assembly">Assembly where migration files exist</param> 82 /// <param name="assembly">Assembly where migration files exist</param>
84 /// <param name="store">Name of the store in use</param> 83 /// <param name="store">Name of the store in use</param>
85 private void runMigration(string dialect, Assembly assembly, string store) 84 private void RunMigration(string dialect, Assembly assembly, string store)
86 { 85 {
87 // Migration subtype is the folder name under which migrations are stored. For mysql this folder is 86 // Migration subtype is the folder name under which migrations are stored. For mysql this folder is
88 // MySQLDialect instead of MySQL5Dialect which is the dialect currently in use. To avoid renaming 87 // MySQLDialect instead of MySQL5Dialect which is the dialect currently in use. To avoid renaming
@@ -104,7 +103,7 @@ namespace OpenSim.Data.NHibernate
104 /// <param name="store">Name of the store</param> 103 /// <param name="store">Name of the store</param>
105 public NHibernateManager(string connect, string store) 104 public NHibernateManager(string connect, string store)
106 { 105 {
107 parseConnectionString(connect); 106 ParseConnectionString(connect);
108 107
109 //To create sql file uncomment code below and write the name of the file 108 //To create sql file uncomment code below and write the name of the file
110 //SchemaExport exp = new SchemaExport(cfg); 109 //SchemaExport exp = new SchemaExport(cfg);
@@ -113,7 +112,8 @@ namespace OpenSim.Data.NHibernate
113 112
114 Assembly assembly = GetType().Assembly; 113 Assembly assembly = GetType().Assembly;
115 114
116 runMigration(dialect, assembly, store); 115 sessionFactory = configuration.BuildSessionFactory();
116 RunMigration(dialect, assembly, store);
117 } 117 }
118 118
119 /// <summary> 119 /// <summary>
@@ -121,14 +121,14 @@ namespace OpenSim.Data.NHibernate
121 /// </summary> 121 /// </summary>
122 /// <param name="connect">NHibernate dialect, driver and connection string separated by ';'</param> 122 /// <param name="connect">NHibernate dialect, driver and connection string separated by ';'</param>
123 /// <param name="store">Name of the store</param> 123 /// <param name="store">Name of the store</param>
124 /// <param name="assembly"></param> 124 /// <param name="assembly">Outside assembly to be included </param>
125 public NHibernateManager(string connect, string store, Assembly assembly) 125 public NHibernateManager(string connect, string store, Assembly assembly)
126 { 126 {
127 parseConnectionString(connect); 127 ParseConnectionString(connect);
128 128
129 configuration.AddAssembly(assembly); 129 configuration.AddAssembly(assembly);
130 130 sessionFactory = configuration.BuildSessionFactory();
131 runMigration(dialect, assembly, store); 131 RunMigration(dialect, assembly, store);
132 } 132 }
133 133
134 public object Load(Type type, UUID uuid) 134 public object Load(Type type, UUID uuid)