Berat Yesbek
Dec 25, 2023

--

Hi there, that's a really good question. However, it really depends on business requirements. For example, consider a scenario where there is only one stock of a product, and you've sold it. Another transaction comes into play and attempts to buy it. However, there is no product in stock anymore. When you retry, it will throw an exception, or some other issues might appear. That's why throwing an exception and notifying the client would be useful in that case.

On the other hand, let's say you have a user, and you want to update their name. In this case, when a transaction encounters an error, a retry mechanism is entirely useful. Business analysis will guide us in determining the appropriate approach.

--

--

Berat Yesbek
Berat Yesbek

Responses (1)