* Print out exception information when a mysql asset fetch fails
* Attempt reconnection on fetch and create exceptions.ThreadPoolClientBranch
parent
ce07854a45
commit
dee0d1e55d
|
@ -95,9 +95,12 @@ namespace OpenSim.Framework.Data.MySQL
|
||||||
cmd.Dispose();
|
cmd.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
MainLog.Instance.Warn("ASSETS", "MySql failure fetching asset");
|
MainLog.Instance.Error(
|
||||||
|
"ASSETS", "MySql failure fetching asset" + Environment.NewLine + e.ToString()
|
||||||
|
+ Environment.NewLine + "Attempting reconnection");
|
||||||
|
_dbConnection.Reconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return asset;
|
return asset;
|
||||||
|
@ -112,19 +115,29 @@ namespace OpenSim.Framework.Data.MySQL
|
||||||
_dbConnection.Connection);
|
_dbConnection.Connection);
|
||||||
|
|
||||||
// need to ensure we dispose
|
// need to ensure we dispose
|
||||||
using (cmd)
|
try
|
||||||
{
|
{
|
||||||
MySqlParameter p = cmd.Parameters.Add("?id", MySqlDbType.Binary, 16);
|
using (cmd)
|
||||||
p.Value = asset.FullID.GetBytes();
|
{
|
||||||
cmd.Parameters.AddWithValue("?name", asset.Name);
|
MySqlParameter p = cmd.Parameters.Add("?id", MySqlDbType.Binary, 16);
|
||||||
cmd.Parameters.AddWithValue("?description", asset.Description);
|
p.Value = asset.FullID.GetBytes();
|
||||||
cmd.Parameters.AddWithValue("?assetType", asset.Type);
|
cmd.Parameters.AddWithValue("?name", asset.Name);
|
||||||
cmd.Parameters.AddWithValue("?invType", asset.InvType);
|
cmd.Parameters.AddWithValue("?description", asset.Description);
|
||||||
cmd.Parameters.AddWithValue("?local", asset.Local);
|
cmd.Parameters.AddWithValue("?assetType", asset.Type);
|
||||||
cmd.Parameters.AddWithValue("?temporary", asset.Temporary);
|
cmd.Parameters.AddWithValue("?invType", asset.InvType);
|
||||||
cmd.Parameters.AddWithValue("?data", asset.Data);
|
cmd.Parameters.AddWithValue("?local", asset.Local);
|
||||||
cmd.ExecuteNonQuery();
|
cmd.Parameters.AddWithValue("?temporary", asset.Temporary);
|
||||||
cmd.Dispose();
|
cmd.Parameters.AddWithValue("?data", asset.Data);
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
cmd.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
MainLog.Instance.Error(
|
||||||
|
"ASSETS", "MySql failure creating asset" + Environment.NewLine + e.ToString()
|
||||||
|
+ Environment.NewLine + "Attempting reconnection");
|
||||||
|
_dbConnection.Reconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue