mirror of
https://github.com/opensim/opensim.git
synced 2026-07-08 13:56:26 +08:00
add DeleteAsset
this also moves commit points around a bit for debuging, though this will change back now the MW has worked out synchronization
This commit is contained in:
@@ -121,11 +121,8 @@ namespace OpenSim.Framework.Data.SQLite
|
||||
{
|
||||
fillAssetRow(row, asset);
|
||||
}
|
||||
if (ds.HasChanges()) {
|
||||
DataSet changed = ds.GetChanges();
|
||||
da.Update(changed, "assets");
|
||||
ds.AcceptChanges();
|
||||
}
|
||||
da.Update(ds, "assets");
|
||||
ds.AcceptChanges();
|
||||
}
|
||||
|
||||
public bool ExistsAsset(LLUUID uuid)
|
||||
@@ -133,15 +130,22 @@ namespace OpenSim.Framework.Data.SQLite
|
||||
DataRow row = ds.Tables["assets"].Rows.Find(uuid);
|
||||
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();
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
||||
Reference in New Issue
Block a user