From 207bf2e4cfc68287cd47516fce7aa3f6025af86e Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Tue, 11 Sep 2007 05:26:14 +0000 Subject: [PATCH] add DeleteAsset this also moves commit points around a bit for debuging, though this will change back now the MW has worked out synchronization --- .../Framework/Data.SQLite/SQLiteAssetData.cs | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs b/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs index f50cc0369d..aef9350aac 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs @@ -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(); } /***********************************************************************