Create a gist now

Instantly share code, notes, and snippets.

Embed
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”/>
</map>
</property>
<!– Default DataSource –>
<property name=”defaultTargetDataSource” ref=”standbyDataSource” />
</bean>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment