private void DoDispose() { _transaction.Dispose(); if (Connection?.CurrentTransaction == this) { Connection.CurrentTransaction = null; } Connection = null; }
public AbstractCommandExecutor(ShardingConnection shardingConnection) { this.DatabaseType = shardingConnection.GetRuntimeContext().GetDatabaseType(); this.Connection = shardingConnection; // int maxConnectionsSizePerQuery = connection.GetRuntimeContext().GetProperties().<Integer>getValue(ConfigurationPropertyKey.MAX_CONNECTIONS_SIZE_PER_QUERY); int maxConnectionsSizePerQuery = 1; ExecutorEngine executorEngine = Connection.GetRuntimeContext().GetExecutorEngine(); SqlExecutePrepareTemplate = new SqlExecutePrepareTemplate(maxConnectionsSizePerQuery); SqlExecuteTemplate = new SqlExecuteTemplate(executorEngine, Connection.IsHoldTransaction()); }
public ShardingCommand(string commandText, ShardingConnection connection) { _shardingConnection = connection; _commandExecutor = CreateCommandExecutor(10); }
public CommandExecutor(ShardingConnection shardingConnection) : base(shardingConnection) { }
public ShardingTransaction(DbTransaction transaction, ShardingConnection shardingConnection) { _transaction = transaction; Connection = shardingConnection; }