Is it possible to uniquely identify a confD transaction?

Hello,

I have the need to, inside the get_object callback in my code identify the confD transaction uniquely somehow. The pointer to the confd_trans_ctx struct received as a parameter in the callback would be an option if another transaction couldn’t have the same memory address later.

I have noticed, though, that the same confd_trans_ctx struct has as a member one integer called thandle. I have also observed that each time my callback gets called this value changes.

I wonder if every transaction has a different thandle identifier. If so, I could use this value to identify a different transaction. If what I have said is not true, is there a way to identify different transactions through the confd_trans_ctx struct?

Thanks

Yes, thandle is number that identifies transaction (id), so you can use it.

1 Like

@Cannagia: Note that if your data provider need to be aware of which “transaction id” the request for data originates from you may also have a need to be “traversal_id” aware in your get_next/find_next callback(s).

However, ConfD does not require a stateful data provider application, your application may have that need. Keeping your data provider stateless makes it less complex since you don’t have to bother looking up transaction id or traversal id states.

See here for an example:
How to add the support of the find_next_object() callback to the 5-c_stats example?