Package com.homannsoftware.transactions
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 Summary
ConstructorsConstructorDescriptionDemoRunner(CheckoutService service, org.springframework.jdbc.core.JdbcTemplate jdbc) Creates the command-line demonstration. -
Method Summary
-
Constructor Details
-
DemoRunner
Creates the command-line demonstration.- Parameters:
service- proxied checkout servicejdbc- helper for observing committed database state
-
-
Method Details
-
run
Demonstrates that the second reservation is rolled back.- Specified by:
runin interfaceorg.springframework.boot.CommandLineRunner- Parameters:
args- unused command-line arguments
-