public interface ReaderResolver
ReaderCandidateSource with a
LoadBalancingPolicy and applies
the per-call connect/retry loop.| Modifier and Type | Method and Description |
|---|---|
default void |
closeStaleReaderIfNecessary(RwSplitContext ctx)
Closes the cached reader connection if it is no longer valid (e.g.
|
default boolean |
isPerQuery()
Whether this resolver performs query-level load balancing (a fresh reader is selected on each
read-routing decision rather than a single sticky reader being reused).
|
void |
switchToReader(RwSplitContext ctx)
Establishes a fresh reader connection (selecting a candidate, connecting, binding, and
switching the current connection to it).
|
void switchToReader(RwSplitContext ctx) throws java.sql.SQLException
initializeReaderConnection.ctx - the read/write splitting contextjava.sql.SQLExceptiondefault void closeStaleReaderIfNecessary(RwSplitContext ctx)
ctx - the read/write splitting contextdefault boolean isPerQuery()
false keeps the sticky-reader behavior.true for per-query reader balancing; false (default) for sticky