added some debugging for tracing where asset code isn't working with sqlite

afrisby
Sean Dague 2007-09-10 13:34:20 +00:00
parent ffe9c9374a
commit a1be7f4be5
4 changed files with 328 additions and 305 deletions

View File

@ -128,7 +128,7 @@ namespace OpenSim.Framework.Communications.Caches
{
ARequest req = this._assetRequests.Dequeue();
m_plugin.FetchAsset(req.AssetID);
MainLog.Instance.Verbose("Requesting asset: " + req.AssetID);
AssetBase asset = m_plugin.FetchAsset(req.AssetID);
if (asset != null)
@ -269,6 +269,7 @@ namespace OpenSim.Framework.Communications.Caches
string fileName = source.Configs[i].GetString("fileName", "");
if (fileName != "")
{
MainLog.Instance.Verbose("Creating new asset: " + newAsset.Name);
this.LoadAsset(newAsset, false, fileName);
m_plugin.CreateAsset(newAsset);
}

View File

@ -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();
}
}
/***********************************************************************

View File

@ -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 {

View File

@ -35,15 +35,14 @@ namespace OpenSim.Framework.Types
public LLUUID FullID;
public sbyte Type;
public sbyte InvType;
public string Name;
public string Description;
public bool Local;
public bool Temporary;
public string Name = "";
public string Description = "";
public bool Local = false;
public bool Temporary = false;
public AssetBase()
{
Name = " ";
Description = " ";
}
}
}