move the locks closer to the data, sqlite for assets now works like a champ
parent
b3777729b4
commit
a1e2fea7c1
|
@ -200,10 +200,7 @@ namespace OpenSim.Framework.Communications.Caches
|
|||
//Console.WriteLine("new texture to send");
|
||||
TextureSender sender = new TextureSender(req);
|
||||
//sender.OnComplete += this.TextureSent;
|
||||
lock (this.SendingTextures)
|
||||
{
|
||||
this.SendingTextures.Add(req.ImageInfo.FullID, sender);
|
||||
}
|
||||
this.QueueTextures.Enqueue(sender);
|
||||
}
|
||||
|
||||
|
@ -262,14 +259,11 @@ namespace OpenSim.Framework.Communications.Caches
|
|||
public void TextureSent(TextureSender sender)
|
||||
{
|
||||
if (this.SendingTextures.ContainsKey(sender.request.ImageInfo.FullID))
|
||||
{
|
||||
lock (this.SendingTextures)
|
||||
{
|
||||
this.SendingTextures.Remove(sender.request.ImageInfo.FullID);
|
||||
// this.AvatarRecievedTextures[sender.request.RequestUser.AgentId].Add(sender.request.ImageInfo.FullID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void AssetReceived(AssetBase asset, bool IsTexture)
|
||||
{
|
||||
|
|
|
@ -62,6 +62,7 @@ namespace OpenSim.Framework.Data.SQLite
|
|||
ds = new DataSet();
|
||||
da = new SqliteDataAdapter(new SqliteCommand(assetSelect, conn));
|
||||
|
||||
lock (ds) {
|
||||
ds.Tables.Add(createAssetsTable());
|
||||
|
||||
setupAssetCommands(da, conn);
|
||||
|
@ -73,7 +74,7 @@ namespace OpenSim.Framework.Data.SQLite
|
|||
{
|
||||
MainLog.Instance.Verbose("AssetStorage", "Caught fill error on asset table");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -110,6 +111,7 @@ namespace OpenSim.Framework.Data.SQLite
|
|||
", Local: " + asset.Local +
|
||||
", Data Length: " + asset.Data.Length );
|
||||
DataTable assets = ds.Tables["assets"];
|
||||
lock(ds) {
|
||||
DataRow row = assets.Rows.Find(asset.FullID);
|
||||
if (row == null)
|
||||
{
|
||||
|
@ -121,8 +123,7 @@ namespace OpenSim.Framework.Data.SQLite
|
|||
{
|
||||
fillAssetRow(row, asset);
|
||||
}
|
||||
da.Update(ds, "assets");
|
||||
ds.AcceptChanges();
|
||||
}
|
||||
}
|
||||
|
||||
public bool ExistsAsset(LLUUID uuid)
|
||||
|
@ -133,19 +134,21 @@ namespace OpenSim.Framework.Data.SQLite
|
|||
|
||||
public void DeleteAsset(LLUUID uuid)
|
||||
{
|
||||
lock (ds) {
|
||||
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");
|
||||
// da.Update(ds, "assets");
|
||||
// ds.AcceptChanges();
|
||||
lock (ds) {
|
||||
da.Update(ds, "assets");
|
||||
ds.AcceptChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
|
Loading…
Reference in New Issue