another misplaced close
parent
504736eb43
commit
76337b1d8e
|
@ -158,10 +158,6 @@ namespace OpenSim.Data.MySQL
|
||||||
/// <remarks>On failure : Throw an exception and attempt to reconnect to database</remarks>
|
/// <remarks>On failure : Throw an exception and attempt to reconnect to database</remarks>
|
||||||
override public bool StoreAsset(AssetBase asset)
|
override public bool StoreAsset(AssetBase asset)
|
||||||
{
|
{
|
||||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
|
||||||
{
|
|
||||||
dbcon.Open();
|
|
||||||
|
|
||||||
string assetName = asset.Name;
|
string assetName = asset.Name;
|
||||||
if (asset.Name.Length > AssetBase.MAX_ASSET_NAME)
|
if (asset.Name.Length > AssetBase.MAX_ASSET_NAME)
|
||||||
{
|
{
|
||||||
|
@ -180,6 +176,9 @@ namespace OpenSim.Data.MySQL
|
||||||
asset.Description, asset.ID, asset.Description.Length, assetDescription.Length);
|
asset.Description, asset.ID, asset.Description.Length, assetDescription.Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||||
|
{
|
||||||
|
dbcon.Open();
|
||||||
using (MySqlCommand cmd =
|
using (MySqlCommand cmd =
|
||||||
new MySqlCommand(
|
new MySqlCommand(
|
||||||
"replace INTO assets(id, name, description, assetType, local, temporary, create_time, access_time, asset_flags, CreatorID, data)" +
|
"replace INTO assets(id, name, description, assetType, local, temporary, create_time, access_time, asset_flags, CreatorID, data)" +
|
||||||
|
@ -202,16 +201,17 @@ namespace OpenSim.Data.MySQL
|
||||||
cmd.Parameters.AddWithValue("?asset_flags", (int)asset.Flags);
|
cmd.Parameters.AddWithValue("?asset_flags", (int)asset.Flags);
|
||||||
cmd.Parameters.AddWithValue("?data", asset.Data);
|
cmd.Parameters.AddWithValue("?data", asset.Data);
|
||||||
cmd.ExecuteNonQuery();
|
cmd.ExecuteNonQuery();
|
||||||
|
dbcon.Close();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
m_log.ErrorFormat("[ASSET DB]: MySQL failure creating asset {0} with name \"{1}\". Error: {2}",
|
m_log.ErrorFormat("[ASSET DB]: MySQL failure creating asset {0} with name \"{1}\". Error: {2}",
|
||||||
asset.FullID, asset.Name, e.Message);
|
asset.FullID, asset.Name, e.Message);
|
||||||
|
dbcon.Close();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dbcon.Close();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue