Hello,
Trying to implement a transaction library using the libcouchbase C SDK, where I use “BEGIN WORK” to get the transaction ID followed by my DML statements where I pass the txid returned from BEGIN.
I use the below options for lcb_CMDQUERY to set the txid and other details like timeout.
lcb_cmdquery_option(cmd, “pretty”, strlen(“pretty”), “true”, strlen(“true”));
lcb_cmdquery_option(cmd, “txtimeout”, strlen(“txtimeout”), “"3s"”, strlen(“"3s"”));
lcb_cmdquery_option(cmd, “txid”, strlen(“txid”), txid.c_str(), txid.size());
However I observed that lcb_cmdquery_option option for txid returns the error LCB_ERR_INVALID_ARGUMENT.
Although this is intermittent, it works sometimes, but doesn’t work most of the times. I checked the txid it is passing the correct one, example "“d81c5329-5713-4fe8-a8f4-ac95b232d42b”.
Is there a different way to use transactions in the C SDK?