Transaction callback and cdb two-phase subscription mechanism


I need clarity on whether to use cdb two phase commit mechanism or transaction callback for my requirement.

COM-CLI is already implemented in our application. We are adding confd support to our application. So we are re-using the XML parsing already implemented.

Implemented most of the validations in yang models itself as there are no external dependencies.

I have doubt on how to receive data from CDB after a command is committed from confd-cli.

After going through the user guide I found transaction call back mechanism is also used.

Just want to know when actually we use transaction callback and cdb two-phase commit.

Durga Prakash

If you are using CDB as your database for configuration data, best practice is to use the CDB subscription mechanism.

See ConfD examples under examples.confd/cdb_subscription/iter_c and trigger. For a more advanced CDB two-phase subscriber example see examples.confd/cdb_subscription/twophase example.

See also ConfD UG and training videos (module 10)

Yes, I agree with @cohult. Use subscription.

In case your validations are strong enough and you are
sure everything would pass OK, you can use regular (one phase) subscription.

In case some error can occur during subscription processing, use two phase subscription and
abort subscription (transaction) in the first phase of subscription.
See description of cdb_subscribe2 function.