/// <summary> /// 开启事务 /// </summary> /// <returns></returns> public void BeginTransaction() { if (LongDbConnection == null) { LongDbConnection = DbProvider.GetDbProviderFactory().CreateConnection(); LongDbConnection.ConnectionString = _connectionString.ConnectionValue; LongDbConnection.Open(); LongDbTransaction = LongDbConnection.BeginTransaction(); } }
/// <summary> /// 开启事务 /// </summary> /// <returns></returns> public void BeginTransaction() { if (LongDbConnection == null) { //LongDbConnection = dataSource.GetConnection(); LongDbConnection = (IDbConnection)repositoryOption.DbConnectionType.CreateInstance(null); LongDbConnection.ConnectionString = repositoryOption.ConnectionString; LongDbConnection.Open(); LongDbTransaction = LongDbConnection.BeginTransaction(); } }