Step 5: Data Access Operations

Once the database is opened and a connection established, the application can begin performing read and write storage operations as demonstrated in SDK sample samples/native/core/04_operations. To perform any storage operation, the application must first start a database transaction by calling function mco_trans_start(). Once a transaction is opened, the transaction handle is passed to the generated classname_new() function to create a new instance of the object in the database. The object’s handle is used for the generated classname_fieldname_get() and classname_fieldname_put() operations to insert values into the object. The new values are stored in the database when mco_trans_commit() is called with the transaction handle.