aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/MSSQL/MSSQLXInventoryData.cs')
-rw-r--r--OpenSim/Data/MSSQL/MSSQLXInventoryData.cs47
1 files changed, 9 insertions, 38 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs b/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs
index eb636cf..e261aba 100644
--- a/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs
@@ -122,7 +122,7 @@ namespace OpenSim.Data.MSSQL
122 } 122 }
123 } 123 }
124 124
125 public class MSSQLItemHandler : MSSQLGenericTableHandler<XInventoryItem> 125 public class MSSQLItemHandler : MSSQLInventoryHandler<XInventoryItem>
126 { 126 {
127 public MSSQLItemHandler(string c, string t, string m) : 127 public MSSQLItemHandler(string c, string t, string m) :
128 base(c, t, m) 128 base(c, t, m)
@@ -213,43 +213,9 @@ namespace OpenSim.Data.MSSQL
213 213
214 return true; 214 return true;
215 } 215 }
216
217 private bool IncrementFolderVersion(UUID folderID)
218 {
219 return IncrementFolderVersion(folderID.ToString());
220 }
221
222 private bool IncrementFolderVersion(string folderID)
223 {
224// m_log.DebugFormat("[MYSQL ITEM HANDLER]: Incrementing version on folder {0}", folderID);
225// Util.PrintCallStack();
226
227 string sql = "update inventoryfolders set version=version+1 where folderID = ?folderID";
228
229 using (SqlConnection conn = new SqlConnection(m_ConnectionString))
230 {
231 using (SqlCommand cmd = new SqlCommand(sql, conn))
232 {
233 conn.Open();
234
235 cmd.Parameters.AddWithValue("@folderID", folderID);
236
237 try
238 {
239 cmd.ExecuteNonQuery();
240 }
241 catch (Exception)
242 {
243 return false;
244 }
245 }
246 }
247
248 return true;
249 }
250 } 216 }
251 217
252 public class MSSQLFolderHandler : MSSQLGenericTableHandler<XInventoryFolder> 218 public class MSSQLFolderHandler : MSSQLInventoryHandler<XInventoryFolder>
253 { 219 {
254 public MSSQLFolderHandler(string c, string t, string m) : 220 public MSSQLFolderHandler(string c, string t, string m) :
255 base(c, t, m) 221 base(c, t, m)
@@ -296,13 +262,18 @@ namespace OpenSim.Data.MSSQL
296 262
297 return true; 263 return true;
298 } 264 }
265 }
266
267 public class MSSQLInventoryHandler<T> : MSSQLGenericTableHandler<T> where T: class, new()
268 {
269 public MSSQLInventoryHandler(string c, string t, string m) : base(c, t, m) {}
299 270
300 private bool IncrementFolderVersion(UUID folderID) 271 protected bool IncrementFolderVersion(UUID folderID)
301 { 272 {
302 return IncrementFolderVersion(folderID.ToString()); 273 return IncrementFolderVersion(folderID.ToString());
303 } 274 }
304 275
305 private bool IncrementFolderVersion(string folderID) 276 protected bool IncrementFolderVersion(string folderID)
306 { 277 {
307// m_log.DebugFormat("[MYSQL ITEM HANDLER]: Incrementing version on folder {0}", folderID); 278// m_log.DebugFormat("[MYSQL ITEM HANDLER]: Incrementing version on folder {0}", folderID);
308// Util.PrintCallStack(); 279// Util.PrintCallStack();