internal void StartTransaction() { // TODO:ReadOnly? // TODO:Session?Global? string cmd; switch (IsolationLevel) { case MySqlIsolationLevel.ReadCommitted: cmd = "SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;START TRANSACTION;"; break; case MySqlIsolationLevel.ReadUncommitted: cmd = "SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;START TRANSACTION;"; break; case MySqlIsolationLevel.RepeatableRead: cmd = "SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;START TRANSACTION;"; break; case MySqlIsolationLevel.Serializable: cmd = "SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;START TRANSACTION;"; break; case MySqlIsolationLevel.Unspecified: cmd = "START TRANSACTION;"; break; default: throw new NotSupportedException("TODO msg"); } var resultSet = driver.Query(cmd); resultSet.ReadToEnd(); }
public TransactionController(MySqlDriver driver) { driver.Query("START TRANSACTION"); }