mco_edge_trans_start

Starts a transaction on an edge database instance.

For an overview, see the Edge Client page.

Prototype

    MCO_RET mco_edge_trans_start(mco_edge_h eh, mco_trans_h *p_trans);
    

Arguments

eh
Connection handle obtained from a previous mco_edge_connect() call.
p_trans
Pointer to an mco_trans_h handle that will receive the transaction reference. This handle is valid only within the current thread and must be used for all subsequent operations in the transaction.

Description

Starts a transaction on the edge database instance associated with the specified connection handle, analogous to mco_trans_start() in the core runtime.

All transactions are implicitly read-write. There are no read-only transactions because edge database are not searchable/navigable; edge databases are effectively write-only. Also the transaction manager is MURSIW: if multiple threads execute transactions, they are processed sequentially.

Return Codes

MCO_S_OK
Transaction started successfully.
MCO_E_ILLEGAL_PARAM
One or more parameter values are invalid (e.g., NULL eh or p_trans).
MCO_E_NOINSTANCE
The connection handle eh does not refer to a valid, open edge database instance.

Files

Header file:
mcoedge.h
Source file:
mcoedgedb.c
Library:
libmcoiotedge.a