Locks added in MySQLConnector

main
Inga 🏳‍🌈 15 years ago
parent 024f4c5c4e
commit b401ed57f6
  1. 5
      MySQLConnector/Connection.cs

@ -27,6 +27,7 @@ namespace FLocal.MySQLConnector {
} }
public List<Dictionary<string, string>> LoadByIds(ITableSpec table, List<string> ids) { public List<Dictionary<string, string>> LoadByIds(ITableSpec table, List<string> ids) {
lock(this) {
using(MySqlCommand command = this.connection.CreateCommand()) { using(MySqlCommand command = this.connection.CreateCommand()) {
command.CommandType = System.Data.CommandType.Text; command.CommandType = System.Data.CommandType.Text;
@ -61,9 +62,10 @@ namespace FLocal.MySQLConnector {
return result; return result;
} }
} }
}
public List<string> LoadIdsByConditions(ITableSpec table, FLocal.Core.DB.conditions.AbstractCondition conditions, Diapasone diapasone, JoinSpec[] joins, SortSpec[] sorts) { public List<string> LoadIdsByConditions(ITableSpec table, FLocal.Core.DB.conditions.AbstractCondition conditions, Diapasone diapasone, JoinSpec[] joins, SortSpec[] sorts) {
lock(this) {
using(MySqlCommand command = this.connection.CreateCommand()) { using(MySqlCommand command = this.connection.CreateCommand()) {
command.CommandType = System.Data.CommandType.Text; command.CommandType = System.Data.CommandType.Text;
@ -108,6 +110,7 @@ namespace FLocal.MySQLConnector {
} }
} }
} }
}
public FLocal.Core.DB.Transaction beginTransaction(System.Data.IsolationLevel iso) { public FLocal.Core.DB.Transaction beginTransaction(System.Data.IsolationLevel iso) {
lock(this) { lock(this) {

Loading…
Cancel
Save