Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
DataSource가 RoutingDataSource에서 판단되는 값에 따라 설정될 수 있도록 아래와 같이 Context 설정을 해준다.
<bean id=”dataSource” class=”kr.sidnancy.common.inf.datasource.RoutingDataSource”>
<property name=”targetDataSources”>
<map key-type=”kr.sidnancy.common.type.DataSourceType”>
<entry key=”MASTER” value-ref=”primaryDataSource” />
<entry key=”SLAVE” value-ref=”standbyDataSource” />
<entry key=”DIST_READ” value-ref=”distReadDataSource”/>
<entry key=”DIST_WRITE” value-ref=”distWriteDataSource”/>
<!– Default DataSource –>
<property name=”defaultTargetDataSource” ref=”standbyDataSource” />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.