Files
java-interview-lab/experienced-2-3y/output/04-spring-di-tx.txt
T

17 lines
847 B
Plaintext

== Q18: constructor injection ==
Invoice built with plain new and a lambda, no Spring context: total(100) = 110.0
Invoice from the context (FlatGst 18%): total(100) = 118.0
== Q19: singleton state is shared ==
two getBean(SingletonCounter) calls return the same object: true
caller A next() = 1, caller B next() = 2
two getBean(PrototypeCounter) calls return the same object: false
caller A next() = 1, caller B next() = 1
== Q20: @Transactional and self-invocation ==
TxProbe injected as a Spring proxy: true
probe.inner() -> transaction active = true
probe.outerCallsInner() -> transaction active = false
== Q21: which exceptions roll back ==
RuntimeException after save -> rows added = 0
checked IOException after save -> rows added = 1
checked + rollbackFor = Exception.class -> rows added = 0