Make a quick stab at the "Open data reader" issue.
MySqlDataReader needs to be Close()d explicitly. Disposing it or letting it fall out of scope will not free it's hold on the connection.0.6.1-post-fixes
parent
3de41ea377
commit
8e119130c5
|
@ -212,16 +212,23 @@ namespace OpenSim.Data.MySQL
|
||||||
{
|
{
|
||||||
MySqlCommand cmd = new MySqlCommand(m_waitTimeoutSelect, m_connection);
|
MySqlCommand cmd = new MySqlCommand(m_waitTimeoutSelect, m_connection);
|
||||||
|
|
||||||
using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
lock (m_dataSet)
|
||||||
{
|
{
|
||||||
if (dbReader.Read())
|
MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow);
|
||||||
|
try
|
||||||
{
|
{
|
||||||
m_waitTimeout
|
if (dbReader.Read())
|
||||||
= Convert.ToInt32(dbReader["@@wait_timeout"]) * TimeSpan.TicksPerSecond + m_waitTimeoutLeeway;
|
{
|
||||||
}
|
m_waitTimeout
|
||||||
|
= Convert.ToInt32(dbReader["@@wait_timeout"]) * TimeSpan.TicksPerSecond + m_waitTimeoutLeeway;
|
||||||
|
}
|
||||||
|
|
||||||
dbReader.Close();
|
cmd.Dispose();
|
||||||
cmd.Dispose();
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
dbReader.Close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_lastConnectionUse = System.DateTime.Now.Ticks;
|
m_lastConnectionUse = System.DateTime.Now.Ticks;
|
||||||
|
@ -571,7 +578,8 @@ namespace OpenSim.Data.MySQL
|
||||||
lock (m_dataSet)
|
lock (m_dataSet)
|
||||||
{
|
{
|
||||||
CheckConnection();
|
CheckConnection();
|
||||||
using (MySqlDataReader row = cmd.ExecuteReader())
|
MySqlDataReader row = cmd.ExecuteReader();
|
||||||
|
try
|
||||||
{
|
{
|
||||||
int rev = 0;
|
int rev = 0;
|
||||||
if (row.Read())
|
if (row.Read())
|
||||||
|
@ -595,6 +603,10 @@ namespace OpenSim.Data.MySQL
|
||||||
|
|
||||||
m_log.Info("[REGION DB]: Loaded terrain revision r" + rev.ToString());
|
m_log.Info("[REGION DB]: Loaded terrain revision r" + rev.ToString());
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
row.Close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return terret;
|
return terret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue