Created
September 19, 2021 14:11
-
-
Save hoangnt-2197/72403a657e0b2abb704010d468ff9e9c to your computer and use it in GitHub Desktop.
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
public class TransactionRoutingDataSource | |
extends AbstractRoutingDataSource { | |
@Nullable | |
@Override | |
protected Object determineCurrentLookupKey() { | |
return TransactionSynchronizationManager | |
.isCurrentTransactionReadOnly() ? | |
DataSourceType.READ_ONLY : | |
DataSourceType.READ_WRITE; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment