/// <summary> /// 构造 /// </summary> /// <param name="dataBase"></param> protected MySqlDataBaseScope(MySqlDataBase dataBase) { //Trace.WriteLine("Create MySqlDataBaseScope", "MySqlDataBase"); _dataBase = dataBase; MySqlDataBase.DefaultDataBase = dataBase; if (dataBase.Open()) { _isHereOpen = true; } dataBase.QuoteCount += 1; }
/// <summary> /// 构造 /// </summary> /// <param name="dataBase">数据库对象</param> private TransactionScope(MySqlDataBase dataBase) { dbScope = MySqlDataBaseScope.CreateScope(dataBase); _preScope = CurrentScope; CurrentScope = this; _dataBase = dataBase; dataBase.Open(); if (dataBase.Transaction != null) { return; } _beginType = 1; dataBase.Transaction = dataBase.Connection.BeginTransaction(); }