add DeleteAsset

this also moves commit points around a bit for debuging, though 
this will change back now the MW has worked out synchronization
afrisby
Sean Dague 2007-09-11 05:26:14 +00:00
parent 0770a5de0a
commit 207bf2e4cf
1 changed files with 14 additions and 10 deletions

View File

@ -121,12 +121,9 @@ namespace OpenSim.Framework.Data.SQLite
{
fillAssetRow(row, asset);
}
if (ds.HasChanges()) {
DataSet changed = ds.GetChanges();
da.Update(changed, "assets");
da.Update(ds, "assets");
ds.AcceptChanges();
}
}
public bool ExistsAsset(LLUUID uuid)
{
@ -134,14 +131,21 @@ namespace OpenSim.Framework.Data.SQLite
return (row != null);
}
public void DeleteAsset(LLUUID uuid)
{
DataRow row = ds.Tables["assets"].Rows.Find(uuid);
if (row != null) {
row.Delete();
}
da.Update(ds, "assets");
ds.AcceptChanges();
}
public void CommitAssets() // force a sync to the database
{
MainLog.Instance.Verbose("AssetStorage", "Attempting commit");
if (ds.HasChanges()) {
DataSet changed = ds.GetChanges();
da.Update(changed, "assets");
ds.AcceptChanges();
}
// da.Update(ds, "assets");
// ds.AcceptChanges();
}
/***********************************************************************