IConnectionPool.postTransaction

Asynchronous way to execute transaction. User can check transaction status by calling isTransactionReady method. When isTransactionReady method returns true, the transaction can be finalized by getTransaction method.

interface IConnectionPool
immutable(ITransaction)
postTransaction
shared
(
string[] commands
,
string[] params = []
,
uint[] argnums = []
,
string[string] vars = null
,
bool[] oneRowConstraint = []
)
in { assert (commands && params && argnums, "null reference"); assert (argnums.reduce!"a+b" == params.length, "length of params is not equal argument count summ!"); }

Return Value

Type: immutable(ITransaction)

Specific interface to distinct the query among others.

argnums array holds information about which parameter from params should be passed to a query in commands. If there are no params, the argnums can be empty.

oneRowConstraint store info which query in commands have to have one row respond. If some query with the constraint switched on returns 0 or greater than 1 - transaction is rollbacked and OneRowConstraintException is thrown.

Throws

ConnTimeoutException

Examples

pool.postTransaction(["com1", "com2"],
    ["par1", "par2", "par3"], [1, 2]);
// com1 is fed with par1
// com2 is fed with par2 and par3

See Also

isTransactionReady, getTransaction.

Meta