Fix issue with database file handles being left open.

This commit is contained in:
UnknownShadow200 2016-07-06 16:02:35 +10:00
parent 31f81410f6
commit ad59115977
3 changed files with 5 additions and 3 deletions

View File

@ -106,7 +106,7 @@ namespace MCGalaxy.SQL {
public static class SQLite {
static string connStringFormat = "Data Source =" + Server.apppath + "/MCGalaxy.db; Version =3; Pooling ={0}; Max Pool Size =1000;";
static string connStringFormat = "Data Source =" + Server.apppath + "/MCGalaxy.db; Version =3; Pooling ={0}; Max Pool Size =300;";
public static string connString { get { return String.Format(connStringFormat, Server.DatabasePooling); } }
internal static ParameterisedQuery query = new SQLiteParameterisedQuery();

View File

@ -32,8 +32,8 @@ namespace MCGalaxy.SQL {
foreach (var param in parameters)
cmd.Parameters.AddWithValue(param.Key, param.Value);
cmd.ExecuteNonQuery();
conn.Close();
}
conn.Close();
}
}
@ -45,6 +45,7 @@ namespace MCGalaxy.SQL {
foreach (var param in parameters)
da.SelectCommand.Parameters.AddWithValue(param.Key, param.Value);
da.Fill(toReturn);
da.SelectCommand.Dispose();
}
conn.Close();
}

View File

@ -30,8 +30,8 @@ namespace MCGalaxy.SQL {
foreach (var param in parameters)
cmd.Parameters.AddWithValue(param.Key, param.Value);
cmd.ExecuteNonQuery();
conn.Close();
}
conn.Close();
}
}
@ -42,6 +42,7 @@ namespace MCGalaxy.SQL {
foreach (var param in parameters)
da.SelectCommand.Parameters.AddWithValue(param.Key, param.Value);
da.Fill(results);
da.SelectCommand.Dispose();
}
conn.Close();
}