From a1be7f4be50a645be22eb7d80679530906e8aeba Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 10 Sep 2007 13:34:20 +0000 Subject: added some debugging for tracing where asset code isn't working with sqlite --- OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs') diff --git a/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs b/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs index a49043b..f50cc03 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs @@ -100,6 +100,15 @@ namespace OpenSim.Framework.Data.SQLite public void UpdateAsset(AssetBase asset) { + MainLog.Instance.Verbose("AssetStorage", + "Asset: " + asset.FullID + + ", Name: " + asset.Name + + ", Description: " + asset.Description + + ", Type: " + asset.Type + + ", InvType: " + asset.InvType + + ", Temporary: " + asset.Temporary + + ", Local: " + asset.Local + + ", Data Length: " + asset.Data.Length ); DataTable assets = ds.Tables["assets"]; DataRow row = assets.Rows.Find(asset.FullID); if (row == null) @@ -112,6 +121,11 @@ namespace OpenSim.Framework.Data.SQLite { fillAssetRow(row, asset); } + if (ds.HasChanges()) { + DataSet changed = ds.GetChanges(); + da.Update(changed, "assets"); + ds.AcceptChanges(); + } } public bool ExistsAsset(LLUUID uuid) @@ -122,7 +136,12 @@ namespace OpenSim.Framework.Data.SQLite public void CommitAssets() // force a sync to the database { - da.Update(ds, "assets"); + MainLog.Instance.Verbose("AssetStorage", "Attempting commit"); + if (ds.HasChanges()) { + DataSet changed = ds.GetChanges(); + da.Update(changed, "assets"); + ds.AcceptChanges(); + } } /*********************************************************************** -- cgit v1.1