Created
March 1, 2020 14:05
-
-
Save cg4jins/86a68977a1aa0893712854141796c30b to your computer and use it in GitHub Desktop.
RoutingDataSource.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RoutingDataSource : AbstractRoutingDataSource() { | |
override fun determineCurrentLookupKey(): Any { | |
return if (TransactionSynchronizationManager.isCurrentTransactionReadOnly()) "slave" else "master" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment