* More prim inventory synchronization

* Remove some mysql verbosity
ThreadPoolClientBranch
Justin Clarke Casey 2008-01-16 21:43:22 +00:00
parent 7fa6646d6f
commit e13feaa375
2 changed files with 36 additions and 30 deletions

View File

@ -1222,34 +1222,37 @@ namespace OpenSim.Framework.Data.MySQL
foreach (DataRow row in dbItemRows) foreach (DataRow row in dbItemRows)
{ {
MainLog.Instance.Verbose( // MainLog.Instance.Verbose(
"DATASTORE", // "DATASTORE",
"Found item {0}, {1} in prim id {2}", // "Found item {0}, {1} in prim id {2}",
row["name"], row["itemID"], primID); // row["name"], row["itemID"], primID);
dbItemsToRemove.Add((String)row["itemID"], row); dbItemsToRemove.Add((String)row["itemID"], row);
} }
// Eliminate rows from the deletion set which already exist for this prim's inventory // Eliminate rows from the deletion set which already exist for this prim's inventory
// TODO Very temporary, need to take account of simple metadata changes soon // TODO Very temporary, need to take account of simple metadata changes soon
foreach (LLUUID itemId in items.Keys) lock (items)
{ {
String rawItemId = itemId.ToString(); foreach (LLUUID itemId in items.Keys)
if (dbItemsToRemove.ContainsKey(rawItemId))
{ {
MainLog.Instance.Verbose( String rawItemId = itemId.ToString();
"DATASTORE",
"Discarding item {0}, {1} from remove candidates for prim id {2}",
items[itemId].Name, rawItemId, primID);
dbItemsToRemove.Remove(rawItemId); if (dbItemsToRemove.ContainsKey(rawItemId))
} {
else // MainLog.Instance.Verbose(
{ // "DATASTORE",
itemsToAdd.Add(items[itemId]); // "Discarding item {0}, {1} from remove candidates for prim id {2}",
} // items[itemId].Name, rawItemId, primID);
}
dbItemsToRemove.Remove(rawItemId);
}
else
{
itemsToAdd.Add(items[itemId]);
}
}
}
// Delete excess rows // Delete excess rows
foreach (DataRow row in dbItemsToRemove.Values) foreach (DataRow row in dbItemsToRemove.Values)

View File

@ -1283,19 +1283,22 @@ namespace OpenSim.Framework.Data.SQLite
// Eliminate rows from the deletion set which already exist for this prim's inventory // Eliminate rows from the deletion set which already exist for this prim's inventory
// TODO Very temporary, need to take account of simple metadata changes soon // TODO Very temporary, need to take account of simple metadata changes soon
foreach (LLUUID itemId in items.Keys) lock (items)
{ {
String rawItemId = itemId.ToString(); foreach (LLUUID itemId in items.Keys)
if (dbItemsToRemove.ContainsKey(rawItemId))
{ {
dbItemsToRemove.Remove(rawItemId); String rawItemId = itemId.ToString();
}
else if (dbItemsToRemove.ContainsKey(rawItemId))
{ {
itemsToAdd.Add(items[itemId]); dbItemsToRemove.Remove(rawItemId);
} }
} else
{
itemsToAdd.Add(items[itemId]);
}
}
}
// Delete excess rows // Delete excess rows
foreach (DataRow row in dbItemsToRemove.Values) foreach (DataRow row in dbItemsToRemove.Values)