Hint
Hint
is mainly used to perform mandatory data operations in the primary database for read/write splitting scenarios.
- Call
HintManager.getInstance()
to obtain HintManager instance. - Call
HintManager.setWriteRouteOnly()
method to set the primary database routing marks. - Execute SQL statements to complete routing and execution.
- Call to clear the content of ThreadLocal.
Use manual programming
Get HintManager
Configure Primary Database Route
- Use
hintManager.setWriteRouteOnly
to configure primary database route.
Clean Hint Value
The same as data sharding based on hint.
Code:
Use special SQL comments
Terms of Use
Code:
Route to the specified database with Hint
Use manual programming
Get HintManager
The same as sharding based on hint.
Configure Database Route
- Use to configure database route.