fix(lastleg): read committed order command replays after lock waits
This commit is contained in:
+5
-2
@@ -21,6 +21,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Isolation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.server.ResponseStatusException;
|
||||
|
||||
@@ -55,7 +56,9 @@ public class LastlegOrderCommandService {
|
||||
@Resource private InventoryCommandService inventory;
|
||||
@Resource private ObjectMapper objectMapper;
|
||||
|
||||
@Transactional
|
||||
// Ownership is read before waiting for the order lock. Under MySQL repeatable
|
||||
// read that snapshot can hide the preceding writer's idempotency record.
|
||||
@Transactional(isolation = Isolation.READ_COMMITTED)
|
||||
public LastlegOrderCommandDtos.HoldResponse hold(String requestedCustomerId, long orderId,
|
||||
String idempotencyKey,
|
||||
LastlegOrderCommandDtos.HoldRequest request,
|
||||
@@ -122,7 +125,7 @@ public class LastlegOrderCommandService {
|
||||
return response;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Transactional(isolation = Isolation.READ_COMMITTED)
|
||||
public LastlegOrderCommandDtos.ManualNodesResponse saveManualNodes(String requestedCustomerId, long orderId,
|
||||
String idempotencyKey,
|
||||
LastlegOrderCommandDtos.ManualNodesRequest request,
|
||||
|
||||
Reference in New Issue
Block a user