aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/NHibernate/NHibernateManager.cs
diff options
context:
space:
mode:
authorCharles Krinke2009-02-14 19:47:02 +0000
committerCharles Krinke2009-02-14 19:47:02 +0000
commita583d8ad70daad8c755c2f43e2f2af7bc5b7ee4d (patch)
tree7e90740b7ea86922db55905a34e3b6e065cb6041 /OpenSim/Data/NHibernate/NHibernateManager.cs
parentAdd an override for the % operator. (diff)
downloadopensim-SC_OLD-a583d8ad70daad8c755c2f43e2f2af7bc5b7ee4d.zip
opensim-SC_OLD-a583d8ad70daad8c755c2f43e2f2af7bc5b7ee4d.tar.gz
opensim-SC_OLD-a583d8ad70daad8c755c2f43e2f2af7bc5b7ee4d.tar.bz2
opensim-SC_OLD-a583d8ad70daad8c755c2f43e2f2af7bc5b7ee4d.tar.xz
Thank you kindly, TLaukkan (Tommil) for a patch that:
* Created value object for EstateRegionLink for storing the estate region relationship. * Refactored slightly NHibernateManager and NHibernateXXXXData implementations for accesing nhibernate generated ID on insert. ** Changed NHibernateManager.Save method name to Insert as it does Insert. ** Changed NHibernateManager.Save return value object as ID can be both UUID and uint currently. ** Changed NHibernateManager.Load method Id parameter to object as it can be both UUID and uint. * Created NHibernateEstateData implementation. This is the actual estate storage. * Created NHibernate mapping files for both EstateSettings and EstateRegionLink * Created MigrationSyntaxDifferences.txt files to write notes about differences in migration scripts between different databases. * Created estate storage migration scripts for all four databases. * Created estate unit test classes for all four databases. * Updated one missing field to BasicEstateTest.cs * Tested NHibernate unit tests with NUnit GUI. Asset databases fail but that is not related to this patch. * Tested build with both Visual Studio and nant. * Executed build tests with nant succesfully.
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/NHibernate/NHibernateManager.cs14
1 files changed, 7 insertions, 7 deletions
diff --git a/OpenSim/Data/NHibernate/NHibernateManager.cs b/OpenSim/Data/NHibernate/NHibernateManager.cs
index 51467da..26bc219 100644
--- a/OpenSim/Data/NHibernate/NHibernateManager.cs
+++ b/OpenSim/Data/NHibernate/NHibernateManager.cs
@@ -131,25 +131,25 @@ namespace OpenSim.Data.NHibernate
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, Object id)
135 { 135 {
136 using (IStatelessSession session = sessionFactory.OpenStatelessSession()) 136 using (IStatelessSession session = sessionFactory.OpenStatelessSession())
137 { 137 {
138 object obj = null; 138 object obj = null;
139 try 139 try
140 { 140 {
141 obj = session.Get(type.FullName, uuid); 141 obj = session.Get(type.FullName, id);
142 } 142 }
143 catch (Exception e) 143 catch (Exception e)
144 { 144 {
145 m_log.ErrorFormat("[NHIBERNATE] {0} of id {1} loading threw exception: "+ e.ToString(), type.Name, uuid); 145 m_log.ErrorFormat("[NHIBERNATE] {0} of id {1} loading threw exception: " + e.ToString(), type.Name, id);
146 } 146 }
147 return obj; 147 return obj;
148 } 148 }
149 149
150 } 150 }
151 151
152 public bool Save(object obj) 152 public object Insert(object obj)
153 { 153 {
154 try 154 try
155 { 155 {
@@ -157,16 +157,16 @@ namespace OpenSim.Data.NHibernate
157 { 157 {
158 using (ITransaction transaction=session.BeginTransaction()) 158 using (ITransaction transaction=session.BeginTransaction())
159 { 159 {
160 session.Insert(obj); 160 Object identifier=session.Insert(obj);
161 transaction.Commit(); 161 transaction.Commit();
162 return true; 162 return identifier;
163 } 163 }
164 } 164 }
165 } 165 }
166 catch (Exception e) 166 catch (Exception e)
167 { 167 {
168 m_log.Error("[NHIBERNATE] issue inserting object ", e); 168 m_log.Error("[NHIBERNATE] issue inserting object ", e);
169 return false; 169 return null;
170 } 170 }
171 } 171 }
172 172