Package ch.admin.bit.jeap.db.tx
Class ReadReplicaAwareTransactionRoutingDataSource
java.lang.Object
org.springframework.jdbc.datasource.AbstractDataSource
org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
ch.admin.bit.jeap.db.tx.ReadReplicaAwareTransactionRoutingDataSource
- All Implemented Interfaces:
Wrapper,CommonDataSource,DataSource,org.springframework.beans.factory.InitializingBean
public class ReadReplicaAwareTransactionRoutingDataSource
extends org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
This DataSource implementation resolves a target DataSource depending on the read-only value of the top-level
transaction.
The method determineCurrentLookupKey is only called when the top-level transaction is started in a thread.
-
Field Summary
FieldsFields inherited from class org.springframework.jdbc.datasource.AbstractDataSource
logger -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
afterPropertiesSet, createConnectionBuilder, createShardingKeyBuilder, determineTargetDataSource, getConnection, getConnection, getResolvedDataSources, getResolvedDefaultDataSource, initialize, isWrapperFor, resolveSpecifiedDataSource, resolveSpecifiedLookupKey, setDataSourceLookup, setDefaultTargetDataSource, setLenientFallback, setTargetDataSources, unwrapMethods inherited from class org.springframework.jdbc.datasource.AbstractDataSource
getLoginTimeout, getLogWriter, getParentLogger, setLoginTimeout, setLogWriter
-
Field Details
-
READER_KEY
- See Also:
-
WRITER_KEY
- See Also:
-
-
Constructor Details
-
ReadReplicaAwareTransactionRoutingDataSource
public ReadReplicaAwareTransactionRoutingDataSource()
-
-
Method Details
-
determineCurrentLookupKey
- Specified by:
determineCurrentLookupKeyin classorg.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
-