Query regarding transaction-id

HI,

I wanted to understand how is the “transaction handle” assigned in a CONFD transaction.
If there are 5 parallel session trying to get the data provided by a daemon using get_next_object, will all all the get_next_object request use the same transaction handle value?

Thanks,
Naveen

Hi,
If five sessions are each starting a read transaction, each transaction will get a unique transaction ID/handle.
Regards

Here is a simple example using one of the examples: 5-c_stats

$ make start ( started arp daemon) and created control and worker socket.

Then created 2 Cli sessions and ran > show arpentries arpe hwaddr

`Controlsocket: 3
Workersocket: 4
TRACE New user session: 14 for user: ctx:cli --> CONFD_OK
TRACE CALL trans init(thandle=1012,mode="r",db=running) --> CONFD_OK
TRACE CALL data get_next(thandle=1012, /arpentries/arpe, -1) --> CONFD_OK
TRACE CALL data get_elem(thandle=1012,/arpentries/arpe{192.168.1.1 en0}/ip) (192.168.1.1)  --> CONFD_OK
TRACE CALL data get_elem(thandle=1012,/arpentries/arpe{192.168.1.1 en0}/hwaddr) ("34:97:f6:51:c1:a0")  --> CONFD_OK
TRACE CALL data get_next(thandle=1012, /arpentries/arpe, 105553165074480) --> CONFD_OK
TRACE CALL data get_elem(thandle=1012,/arpentries/arpe{192.168.1.26 en0}/ip) (192.168.1.26)  --> CONFD_OK

Subsequent requests from above cli sessions uses same transaction id 1012

Second cli session:
TRACE New user session: 17 for user: ctx:cli --> CONFD_OK
TRACE CALL trans init(thandle=1019,mode="r",db=running) --> CONFD_OK
TRACE CALL data get_next(thandle=1019, /arpentries/arpe, -1) --> CONFD_OK
TRACE CALL data get_elem(thandle=1019,/arpentries/arpe{192.168.1.1 en0}/ip) (192.168.1.1)  --> CONFD_OK
TRACE CALL data get_elem(thandle=1019,/arpentries/arpe{192.168.1.1 en0}/hwaddr) ("34:97:f6:51:c1:a0")  --> CONFD_OK
TRACE CALL data get_next(thandle=1019, /arpentries/arpe, 105553165090864) --> CONFD_OK
TRACE CALL data get_elem(thandle=1019,/arpentries/arpe{192.168.1.26 en0}/ip) (192.168.1.26)  --> CONFD_OK`

So 2 transaction handles 1012 and 1019 are created. Any subsequent request within same session will use the same transaction handle.

Also refer ‘Section 9.7 The Protocol and a Library Threads Discussion’ in the ConfD User Guide.