diff --git a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs
index aa561214d7..1554aa338e 100644
--- a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs
+++ b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs
@@ -126,7 +126,7 @@ namespace OpenSim.Data.SQLite
row["inventoryEveryOnePermissions"] = item.inventoryEveryOnePermissions;
}
- private void addFolder(InventoryFolderBase folder)
+ private void addFolder(InventoryFolderBase folder, bool add)
{
lock (ds)
{
@@ -135,12 +135,18 @@ namespace OpenSim.Data.SQLite
DataRow inventoryRow = inventoryFolderTable.Rows.Find(Util.ToRawUuidString(folder.folderID));
if (inventoryRow == null)
{
+ if (! add)
+ m_log.ErrorFormat("Interface Misuse: Attempting to Update non-existant inventory folder: {0}", folder.folderID);
+
inventoryRow = inventoryFolderTable.NewRow();
fillFolderRow(inventoryRow, folder);
inventoryFolderTable.Rows.Add(inventoryRow);
}
else
{
+ if (add)
+ m_log.ErrorFormat("Interface Misuse: Attempting to Add inventory folder that already exists: {0}", folder.folderID);
+
fillFolderRow(inventoryRow, folder);
}
@@ -170,7 +176,7 @@ namespace OpenSim.Data.SQLite
}
}
- private void addItem(InventoryItemBase item)
+ private void addItem(InventoryItemBase item, bool add)
{
lock (ds)
{
@@ -179,12 +185,18 @@ namespace OpenSim.Data.SQLite
DataRow inventoryRow = inventoryItemTable.Rows.Find(Util.ToRawUuidString(item.inventoryID));
if (inventoryRow == null)
{
+ if (! add)
+ m_log.ErrorFormat("Interface Misuse: Attempting to Update non-existant inventory item: {0}", item.inventoryID);
+
inventoryRow = inventoryItemTable.NewRow();
fillItemRow(inventoryRow, item);
inventoryItemTable.Rows.Add(inventoryRow);
}
else
{
+ if (add)
+ m_log.ErrorFormat("Interface Misuse: Attempting to Add inventory item that already exists: {0}", item.inventoryID);
+
fillItemRow(inventoryRow, item);
}
invItemsDa.Update(ds, "inventoryitems");
@@ -385,7 +397,7 @@ namespace OpenSim.Data.SQLite
/// The item to be created
public void addInventoryItem(InventoryItemBase item)
{
- addItem(item);
+ addItem(item, true);
}
///
@@ -394,7 +406,7 @@ namespace OpenSim.Data.SQLite
/// The updated item
public void updateInventoryItem(InventoryItemBase item)
{
- addItem(item);
+ addItem(item, false);
}
///
@@ -436,7 +448,7 @@ namespace OpenSim.Data.SQLite
/// The inventory folder
public void addInventoryFolder(InventoryFolderBase folder)
{
- addFolder(folder);
+ addFolder(folder, true);
}
///
@@ -445,7 +457,7 @@ namespace OpenSim.Data.SQLite
/// The inventory folder
public void updateInventoryFolder(InventoryFolderBase folder)
{
- addFolder(folder);
+ addFolder(folder, false);
}
///