Class DemoRunner

java.lang.Object
com.homannsoftware.transactions.DemoRunner
All Implemented Interfaces:
org.springframework.boot.CommandLineRunner

@Component @ConditionalOnProperty(name="lab.demo", havingValue="true") public class DemoRunner extends Object implements org.springframework.boot.CommandLineRunner
Prints a successful commit followed by a deliberate duplicate-key rollback.
  • Constructor Details

    • DemoRunner

      public DemoRunner(CheckoutService service, org.springframework.jdbc.core.JdbcTemplate jdbc)
      Creates the command-line demonstration.
      Parameters:
      service - proxied checkout service
      jdbc - helper for observing committed database state
  • Method Details

    • run

      public void run(String... args)
      Demonstrates that the second reservation is rolled back.
      Specified by:
      run in interface org.springframework.boot.CommandLineRunner
      Parameters:
      args - unused command-line arguments