private void DoDispose()
        {
            _transaction.Dispose();
            if (Connection?.CurrentTransaction == this)
            {
                Connection.CurrentTransaction = null;
            }

            Connection = null;
        }
Ejemplo n.º 2
0
        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());
        }
Ejemplo n.º 3
0
 public ShardingCommand(string commandText, ShardingConnection connection)
 {
     _shardingConnection = connection;
     _commandExecutor    = CreateCommandExecutor(10);
 }
Ejemplo n.º 4
0
 public CommandExecutor(ShardingConnection shardingConnection) : base(shardingConnection)
 {
 }
 public ShardingTransaction(DbTransaction transaction, ShardingConnection shardingConnection)
 {
     _transaction = transaction;
     Connection   = shardingConnection;
 }