The transaction id and root context id fields are used to trace a
given request. The field values should be saved in all modules where trace data is
required. Each request made to the server has a different transaction id and all
requests within a given session have the same root context id. Each such session
has different root context ids. For example, consider the following snippet of
client
code:
E2ETraceTestDB.Synchronize();
int id = 121;
Customer customer = new Customer();
customer.Fname = "Ritchie";
customer.Lname = "Dennis";
customer.Id = id;
customer.City = "CA";
customer.Save();
customer.SubmitPending();
E2ETraceTestDB.Synchronize();
For the above code, the log messages in a typical domain log table
can be represented as given below. Here the logs resulting from each synchronize() server call includes a unique TransactionID but both calls include the same
RootContextID:
Transaction and Root Context ID LoggingLogID |
RootContextID |
TransactionID |
LogMessage |
1 |
4635000000311EE09EC5037310AE97A2 |
4635000000311EE09EC5037310AE77A2 |
Msg1 for sync1 |
2 |
4635000000311EE09EC5037310AE97A2 |
4635000000311EE09EC5037310AE77A2 |
msg2 for sync1 |
3 |
4635000000311EE09EC5037310AE97A2 |
4635000000311EE09EC5037310AE77A2 |
msg3 for sync1 |
n+1 |
4635000000311EE09EC5037310AE97A2 |
4635000000311EE09FG5037310BD99A2 |
msg1 for sync2 |
n+2 |
4635000000311EE09EC5037310AE97A2 |
4635000000311EE09FG5037310BD99A2 |
msg2 for sync2 |