java
18 minAdvanced Java and Spring: Runtime, Concurrency, Proxies, and Reactive Failure Modes
A production field guide to GC choice, thread-pool saturation, Spring lifecycle traps, AOP boundaries, and blocking work in reactive services.
Loading page...
java
18 minA production field guide to GC choice, thread-pool saturation, Spring lifecycle traps, AOP boundaries, and blocking work in reactive services.
Q&A
Q&AThe container cannot construct a dependency cycle safely, especially when both beans require constructor injection.
Bean A needs B while B needs A, so neither constructor can complete first. Treat the exception as an ownership/design signal: extract the shared responsibility, invert a dependency, or communicate through an event. Lazy lookup can defer resolution but does not remove the cycle or its coupling.
Q&A
Q&AA blocking call occupies a small Netty event-loop pool and stalls unrelated connections.
Reactive event loops depend on handlers returning promptly. Blocking JDBC parks the event-loop thread while it waits for the database, so many unrelated requests queue behind a few occupied threads. Use a reactive driver end-to-end or isolate unavoidable JDBC work on a bounded worker scheduler and constrain concurrency.
java
9 minA transaction is only as good as the boundary you choose. Learn how service-layer design, isolation levels, and idempotent writes affect correctness in Java systems.
Q&A
Q&AString is immutable; builders are mutable, and StringBuffer synchronizes its methods.
String values are immutable and can be safely shared. StringBuilder supports mutable append operations without synchronization and is usually appropriate for thread-confined construction. StringBuffer synchronizes individual methods, but that does not automatically make a multi-call workflow atomic; synchronization often costs more than needed when a builder is local to one thread.
Q&A
Q&AEnvironment strings and open descriptors not marked close-on-exec.
Construct a deliberate environment and descriptor allowlist. Descriptors grant capabilities to files, sockets, or pipes; inherited writers can delay EOF and inherited secrets can leak to less-trusted children.
unix
8 minTrace what survives fork and exec, and close capabilities a child should not inherit.
Q&A
Q&ATrace why a value is absent and validate or model optionality where it enters the system.
Find the first operation that received None and trace the producer branch, database field, or external payload that supplied it. Decide whether absence is valid: represent it as Optional and handle it explicitly, or reject malformed input at the boundary. Blindly substituting an empty string or zero can hide an invalid state and change business meaning.