public interface SwitchGate
| Modifier and Type | Method and Description |
|---|---|
boolean |
canSwitch(RwSplitContext ctx,
TargetRole desired)
Returns whether a switch to
desired is allowed. |
boolean canSwitch(RwSplitContext ctx, TargetRole desired) throws java.sql.SQLException
desired is allowed. When it returns false the
current connection is pinned (no switch is performed). Implementations may throw to reject an
illegal transition (e.g. setReadOnly(false) inside an active transaction).ctx - the read/write splitting contextdesired - the desired target roletrue if switching is allowed, false to pin the current connectionjava.sql.SQLException