Hi Oracle MicroTx team,
I was going through the TCC Spring Boot sample and had a question about the two-step reservation flow, specifically the /confirm/{tripBookingId} endpoint in the travel-agent service.
From what I understand, the /reserve endpoint creates the reservations and returns a Link header containing the MicroTx TCC transaction URI. Later, the client passes that Link header back when calling /confirm/{tripBookingId}.
However, in the /confirm implementation, the code also fetches the saved TransactionHistory by tripBookingId and reconstructs the participant list from the stored reservation URIs:
BookingHistory.TransactionHistory transactionHistory = service.get(tripBookingId);
List<TccParticipant> participants = getTravelParticipants(transactionHistory);
ConfirmResponse confirmResponse = tccClientService.confirm(participants);
And getTravelParticipants(...) manually builds the participant list using the hotel and flight booking URIs stored in TransactionHistory.
My question is:
If the client is already passing the MicroTx Link header back to /confirm, why does the initiator still need to reconstruct the participant URIs from TransactionHistory?
I originally expected the Link header to be enough for MicroTx to identify the existing TCC transaction and its already-registered participants, especially since the participant services call addTccParticipant(...) during the Try/reservation phase.
So I am trying to understand whether the intended model is:
- The
Link header only identifies or resumes the TCC transaction, but does not by itself provide the participant reservation URIs to the initiator.
- The initiator must persist the reservation URIs itself if confirm/cancel happens in a later HTTP request.
confirm(participants) is used in the two-step flow because the original Try-phase call stack and collected participant headers are no longer available.
addTccParticipant(...) is still needed during the Try phase for protocol-level enlistment, but the two-step sample also stores URIs in application state so they can be supplied again later.
Is that the correct interpretation?
If so, it might be helpful to add a short comment or note in the sample explaining the difference between:
- the MicroTx transaction URI in the
Link header, and
- the participant reservation URIs stored in
TransactionHistory.
Right now, it is a little hard to tell whether the stored participant URI reconstruction is required by the TCC protocol, required only by this sample’s two-step design, or just an implementation choice.
Thanks a lot for the sample. It has been helpful given lack of api documentation.
Hi Oracle MicroTx team,
I was going through the TCC Spring Boot sample and had a question about the two-step reservation flow, specifically the
/confirm/{tripBookingId}endpoint in the travel-agent service.From what I understand, the
/reserveendpoint creates the reservations and returns aLinkheader containing the MicroTx TCC transaction URI. Later, the client passes thatLinkheader back when calling/confirm/{tripBookingId}.However, in the
/confirmimplementation, the code also fetches the savedTransactionHistorybytripBookingIdand reconstructs the participant list from the stored reservation URIs:And
getTravelParticipants(...)manually builds the participant list using the hotel and flight booking URIs stored in TransactionHistory.My question is:
If the client is already passing the MicroTx
Linkheader back to/confirm, why does the initiator still need to reconstruct the participant URIs fromTransactionHistory?I originally expected the
Linkheader to be enough for MicroTx to identify the existing TCC transaction and its already-registered participants, especially since the participant services calladdTccParticipant(...)during the Try/reservation phase.So I am trying to understand whether the intended model is:
Linkheader only identifies or resumes the TCC transaction, but does not by itself provide the participant reservation URIs to the initiator.confirm(participants)is used in the two-step flow because the original Try-phase call stack and collected participant headers are no longer available.addTccParticipant(...)is still needed during the Try phase for protocol-level enlistment, but the two-step sample also stores URIs in application state so they can be supplied again later.Is that the correct interpretation?
If so, it might be helpful to add a short comment or note in the sample explaining the difference between:
Linkheader, andTransactionHistory.Right now, it is a little hard to tell whether the stored participant URI reconstruction is required by the TCC protocol, required only by this sample’s two-step design, or just an implementation choice.
Thanks a lot for the sample. It has been helpful given lack of api documentation.