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 ++++++++++++++++++++- OpenSim/Framework/Data.SQLite/SQLiteBase.cs | 4 ++++ 2 files changed, 24 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework/Data.SQLite') 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(); + } } /*********************************************************************** diff --git a/OpenSim/Framework/Data.SQLite/SQLiteBase.cs b/OpenSim/Framework/Data.SQLite/SQLiteBase.cs index a59804c..06fa3bb 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteBase.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteBase.cs @@ -197,6 +197,8 @@ namespace OpenSim.Framework.Data.SQLite return DbType.UInt64; } else if (type == typeof(System.Double)) { return DbType.Double; + } else if (type == typeof(System.Boolean)) { + return DbType.Boolean; } else if (type == typeof(System.Byte[])) { return DbType.Binary; } else { @@ -220,6 +222,8 @@ namespace OpenSim.Framework.Data.SQLite return "varchar(255)"; } else if (type == typeof(System.Double)) { return "float"; + } else if (type == typeof(System.Boolean)) { + return "integer"; } else if (type == typeof(System.Byte[])) { return "blob"; } else { -- cgit v1.1