Added CloseDBConnection() to replace the old CloseReaderCommand(). This will close the MySQLConnection attached to a MySQLCommand. I'm not sure if this accounts for every time a database connection needs to be closed, but it matches up 1:1 with the places where the database connection was previously being closed
parent
d4a6d9191a
commit
6720369376
|
@ -82,12 +82,16 @@ namespace OpenSim.Data.MySQL
|
||||||
ret.Data[s] = result[s].ToString();
|
ret.Data[s] = result[s].ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CloseDBConnection(cmd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CloseDBConnection(cmd);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Store(AuthenticationData data)
|
public bool Store(AuthenticationData data)
|
||||||
|
|
|
@ -47,7 +47,6 @@ namespace OpenSim.Data.MySQL
|
||||||
protected MySqlFramework(string connectionString)
|
protected MySqlFramework(string connectionString)
|
||||||
{
|
{
|
||||||
m_Connection = new MySqlConnection(connectionString);
|
m_Connection = new MySqlConnection(connectionString);
|
||||||
|
|
||||||
m_Connection.Open();
|
m_Connection.Open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,8 +81,7 @@ namespace OpenSim.Data.MySQL
|
||||||
errorSeen = true;
|
errorSeen = true;
|
||||||
|
|
||||||
m_Connection.Close();
|
m_Connection.Close();
|
||||||
MySqlConnection newConnection = (MySqlConnection)
|
MySqlConnection newConnection = (MySqlConnection)((ICloneable)m_Connection).Clone();
|
||||||
((ICloneable)m_Connection).Clone();
|
|
||||||
m_Connection.Dispose();
|
m_Connection.Dispose();
|
||||||
m_Connection = newConnection;
|
m_Connection = newConnection;
|
||||||
m_Connection.Open();
|
m_Connection.Open();
|
||||||
|
@ -104,14 +102,16 @@ namespace OpenSim.Data.MySQL
|
||||||
|
|
||||||
protected IDataReader ExecuteReader(MySqlCommand cmd)
|
protected IDataReader ExecuteReader(MySqlCommand cmd)
|
||||||
{
|
{
|
||||||
MySqlConnection newConnection = (MySqlConnection)
|
MySqlConnection newConnection = (MySqlConnection)((ICloneable)m_Connection).Clone();
|
||||||
((ICloneable)m_Connection).Clone();
|
|
||||||
|
|
||||||
newConnection.Open();
|
newConnection.Open();
|
||||||
|
|
||||||
cmd.Connection = newConnection;
|
cmd.Connection = newConnection;
|
||||||
|
|
||||||
return cmd.ExecuteReader();
|
return cmd.ExecuteReader();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void CloseDBConnection(MySqlCommand cmd)
|
||||||
|
{
|
||||||
|
cmd.Connection.Dispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,6 +172,8 @@ namespace OpenSim.Data.MySQL
|
||||||
|
|
||||||
retList.Add(ret);
|
retList.Add(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CloseDBConnection(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
return retList;
|
return retList;
|
||||||
|
|
|
@ -97,12 +97,16 @@ namespace OpenSim.Data.MySQL
|
||||||
ret.Data[s] = result[s].ToString();
|
ret.Data[s] = result[s].ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CloseDBConnection(cmd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CloseDBConnection(cmd);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Store(UserAccountData data)
|
public bool Store(UserAccountData data)
|
||||||
|
|
Loading…
Reference in New Issue