public class PreparedStatementRecorder
extends java.lang.Object
implements java.lang.reflect.InvocationHandler
PreparedStatement (or
CallableStatement) so they can be replayed onto a freshly-prepared statement
when a read/write splitting plugin rebinds the statement to a different connection for query-level
load balancing.
The recorder is installed as a Proxy between the wrapper and the real driver statement,
so every setter call is captured without modifying the wrapper's ~45 setter methods. Recording is
only installed when rebinding is enabled (see ConnectionWrapper), so it adds no overhead
to the default configuration.
A statement becomes non-rebindable if a one-shot argument (an InputStream or
Reader) is bound (it cannot be replayed), or once a batch is started (a pending batch must
not be rerouted).
| Modifier and Type | Method and Description |
|---|---|
@Nullable java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args) |