diff options
author | Sean Dague | 2008-07-17 18:59:06 +0000 |
---|---|---|
committer | Sean Dague | 2008-07-17 18:59:06 +0000 |
commit | dd144e12ba7a92d4a92986ccaa66d63d410ef028 (patch) | |
tree | 03aca0f0087568ae975e5c51f3481d3e3fec526d /OpenSim/Data/NHibernate/NHibernateRegionData.cs | |
parent | finish NHibernate mapping for prims, and it even seems to work (diff) | |
download | opensim-SC_OLD-dd144e12ba7a92d4a92986ccaa66d63d410ef028.zip opensim-SC_OLD-dd144e12ba7a92d4a92986ccaa66d63d410ef028.tar.gz opensim-SC_OLD-dd144e12ba7a92d4a92986ccaa66d63d410ef028.tar.bz2 opensim-SC_OLD-dd144e12ba7a92d4a92986ccaa66d63d410ef028.tar.xz |
git merge
Diffstat (limited to 'OpenSim/Data/NHibernate/NHibernateRegionData.cs')
-rw-r--r-- | OpenSim/Data/NHibernate/NHibernateRegionData.cs | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/OpenSim/Data/NHibernate/NHibernateRegionData.cs b/OpenSim/Data/NHibernate/NHibernateRegionData.cs index 3ba3556..8ca0afe 100644 --- a/OpenSim/Data/NHibernate/NHibernateRegionData.cs +++ b/OpenSim/Data/NHibernate/NHibernateRegionData.cs | |||
@@ -26,7 +26,6 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections; | ||
30 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
31 | using System.IO; | 30 | using System.IO; |
32 | using System.Reflection; | 31 | using System.Reflection; |
@@ -113,33 +112,6 @@ namespace OpenSim.Data.NHibernate | |||
113 | { | 112 | { |
114 | return null; | 113 | return null; |
115 | } | 114 | } |
116 | |||
117 | private void SaveOrUpdate(SceneObjectPart p) | ||
118 | { | ||
119 | try | ||
120 | { | ||
121 | ICriteria criteria = session.CreateCriteria(typeof(SceneObjectPart)); | ||
122 | criteria.Add(Expression.Eq("UUID", p.UUID)); | ||
123 | if (criteria.List().Count < 1) | ||
124 | { | ||
125 | session.Save(p); | ||
126 | } | ||
127 | else if (criteria.List().Count == 1) | ||
128 | { | ||
129 | SceneObjectPart old = (SceneObjectPart)criteria.List()[0]; | ||
130 | session.Evict(old); | ||
131 | session.Update(p); | ||
132 | } | ||
133 | else | ||
134 | { | ||
135 | m_log.Error("Not unique"); | ||
136 | } | ||
137 | } | ||
138 | catch (Exception e) | ||
139 | { | ||
140 | m_log.Error("[NHIBERNATE] issue saving asset", e); | ||
141 | } | ||
142 | } | ||
143 | 115 | ||
144 | /// <summary> | 116 | /// <summary> |
145 | /// Adds an object into region storage | 117 | /// Adds an object into region storage |
@@ -153,7 +125,7 @@ namespace OpenSim.Data.NHibernate | |||
153 | foreach (SceneObjectPart part in obj.Children.Values) | 125 | foreach (SceneObjectPart part in obj.Children.Values) |
154 | { | 126 | { |
155 | m_log.InfoFormat("Storing part {0}", part.UUID); | 127 | m_log.InfoFormat("Storing part {0}", part.UUID); |
156 | SaveOrUpdate(part); | 128 | session.SaveOrUpdate(part); |
157 | } | 129 | } |
158 | session.Flush(); | 130 | session.Flush(); |
159 | } | 131 | } |