mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 20:16:36 -04:00
Fix issue with database file handles being left open.
This commit is contained in:
parent
31f81410f6
commit
ad59115977
@ -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();
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user