Posts tagged transactions
One of the legacy applications my team has to maintain has almost always this pattern for dealing with data modification: try { // get the connection // begin transaction // optional...
Consider the following code: public class OnlineShoppingService { @Transactional public void cancelOrder(String id) { if (shipmentRepository.findShipmentForOrder(id) != null) { ...