Hint

    Hint is mainly used to perform mandatory data operations in the primary database for read/write splitting scenarios.

    1. Call HintManager.getInstance() to obtain HintManager instance.
    2. Call HintManager.setWriteRouteOnly() method to set the primary database routing marks.
    3. Execute SQL statements to complete routing and execution.
    4. 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.
    Code:

    Use special SQL comments

    Terms of Use:
    Code: