Class JakartaCheckoutService

java.lang.Object
com.homannsoftware.transactions.JakartaCheckoutService

@Service public class JakartaCheckoutService extends Object
Demonstrates the Jakarta Transactions annotation on a Spring-managed bean.
  • Constructor Details

    • JakartaCheckoutService

      public JakartaCheckoutService(CheckoutRepository repository)
      Creates the alternative checkout service.
      Parameters:
      repository - SQL adapter sharing the application's DataSource
  • Method Details

    • checkout

      public void checkout(String orderRef, String sku, int quantity)
      Applies the same business operation using Jakarta transaction metadata.
      Parameters:
      orderRef - nonblank reference of at most 80 characters
      sku - nonblank product identifier of at most 40 characters
      quantity - positive number of units
      Throws:
      IllegalArgumentException - if an argument is invalid
      OutOfStockException - if the product is missing or insufficient