Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b6u469kis46DspusiL
17 lines
847 B
Plaintext
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
|