aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite
diff options
context:
space:
mode:
authorMelanie2012-11-17 02:03:24 +0000
committerMelanie2012-11-17 02:03:24 +0000
commite4659a83f15acc85a7207a1ff60460cae0b86b78 (patch)
treed0fc79b1cbdb15ce9296f05aacf696c9ad43bc41 /OpenSim/Data/SQLite
parentMerge branch 'master' into careminster (diff)
parentRemove old InventoryService, which has for a long time been replaced by XInve... (diff)
downloadopensim-SC_OLD-e4659a83f15acc85a7207a1ff60460cae0b86b78.zip
opensim-SC_OLD-e4659a83f15acc85a7207a1ff60460cae0b86b78.tar.gz
opensim-SC_OLD-e4659a83f15acc85a7207a1ff60460cae0b86b78.tar.bz2
opensim-SC_OLD-e4659a83f15acc85a7207a1ff60460cae0b86b78.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Data/SQLite')
-rw-r--r--OpenSim/Data/SQLite/SQLiteXInventoryData.cs42
1 files changed, 10 insertions, 32 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
index 87eb31e..2a0a8f6 100644
--- a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
+++ b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
@@ -130,7 +130,7 @@ namespace OpenSim.Data.SQLite
130 } 130 }
131 } 131 }
132 132
133 public class SqliteItemHandler : SQLiteGenericTableHandler<XInventoryItem> 133 public class SqliteItemHandler : SqliteInventoryHandler<XInventoryItem>
134 { 134 {
135 public SqliteItemHandler(string c, string t, string m) : 135 public SqliteItemHandler(string c, string t, string m) :
136 base(c, t, m) 136 base(c, t, m)
@@ -243,37 +243,9 @@ namespace OpenSim.Data.SQLite
243 243
244 return perms; 244 return perms;
245 } 245 }
246
247 private bool IncrementFolderVersion(UUID folderID)
248 {
249 return IncrementFolderVersion(folderID.ToString());
250 }
251
252 private bool IncrementFolderVersion(string folderID)
253 {
254// m_log.DebugFormat("[MYSQL ITEM HANDLER]: Incrementing version on folder {0}", folderID);
255// Util.PrintCallStack();
256
257 using (SqliteCommand cmd = new SqliteCommand())
258 {
259 cmd.CommandText = "update inventoryfolders set version=version+1 where folderID = ?folderID";
260 cmd.Parameters.Add(new SqliteParameter(":folderID", folderID));
261
262 try
263 {
264 cmd.ExecuteNonQuery();
265 }
266 catch (Exception)
267 {
268 return false;
269 }
270 }
271
272 return true;
273 }
274 } 246 }
275 247
276 public class SqliteFolderHandler : SQLiteGenericTableHandler<XInventoryFolder> 248 public class SqliteFolderHandler : SqliteInventoryHandler<XInventoryFolder>
277 { 249 {
278 public SqliteFolderHandler(string c, string t, string m) : 250 public SqliteFolderHandler(string c, string t, string m) :
279 base(c, t, m) 251 base(c, t, m)
@@ -315,12 +287,18 @@ namespace OpenSim.Data.SQLite
315 return true; 287 return true;
316 } 288 }
317 289
318 private bool IncrementFolderVersion(UUID folderID) 290 }
291
292 public class SqliteInventoryHandler<T> : SQLiteGenericTableHandler<T> where T: class, new()
293 {
294 public SqliteInventoryHandler(string c, string t, string m) : base(c, t, m) {}
295
296 protected bool IncrementFolderVersion(UUID folderID)
319 { 297 {
320 return IncrementFolderVersion(folderID.ToString()); 298 return IncrementFolderVersion(folderID.ToString());
321 } 299 }
322 300
323 private bool IncrementFolderVersion(string folderID) 301 protected bool IncrementFolderVersion(string folderID)
324 { 302 {
325// m_log.DebugFormat("[MYSQL ITEM HANDLER]: Incrementing version on folder {0}", folderID); 303// m_log.DebugFormat("[MYSQL ITEM HANDLER]: Incrementing version on folder {0}", folderID);
326// Util.PrintCallStack(); 304// Util.PrintCallStack();