Tag

DynamicDataSource

0 views collected around this technical thread.

Selected Java Interview Questions
Selected Java Interview Questions
Mar 13, 2025 · Backend Development

Implementing Dynamic Data Source Switching in Spring Boot with ThreadLocal and AbstractRoutingDataSource

This article demonstrates how to build a dynamic data source switching mechanism in Spring Boot by leveraging ThreadLocal for thread‑scoped context and AbstractRoutingDataSource for routing, covering manual implementation, annotation‑driven switching, and runtime addition of new data sources.

AbstractRoutingDataSourceDatabaseDynamicDataSource
0 likes · 14 min read
Implementing Dynamic Data Source Switching in Spring Boot with ThreadLocal and AbstractRoutingDataSource
Architect's Guide
Architect's Guide
Sep 6, 2024 · Backend Development

Implementing Dynamic Data Source Switching in Spring Boot with ThreadLocal and AbstractRoutingDataSource

This article demonstrates how to implement dynamic data source switching in a Spring Boot application by leveraging ThreadLocal and AbstractRoutingDataSource, providing step‑by‑step code examples for context holders, custom routing, annotation‑driven switching, and runtime addition of new data sources.

AOPAbstractRoutingDataSourceDatabase
0 likes · 14 min read
Implementing Dynamic Data Source Switching in Spring Boot with ThreadLocal and AbstractRoutingDataSource
Architect's Guide
Architect's Guide
Mar 15, 2024 · Backend Development

Implementing Dynamic Data Source Switching in Spring Boot with ThreadLocal and AbstractRoutingDataSource

This tutorial demonstrates how to build a custom dynamic data source solution in Spring Boot by combining ThreadLocal and AbstractRoutingDataSource, covering the implementation of context holders, routing logic, configuration, testing, annotation‑driven switching, and runtime addition of new data sources.

DynamicDataSourceJavaMyBatis
0 likes · 16 min read
Implementing Dynamic Data Source Switching in Spring Boot with ThreadLocal and AbstractRoutingDataSource
Architect
Architect
Dec 18, 2023 · Backend Development

Implementing Dynamic Data Source Switching in Spring Boot with ThreadLocal and AbstractRoutingDataSource

This article demonstrates how to build a custom dynamic data‑source solution for Spring Boot by using ThreadLocal to store the current datasource key, extending AbstractRoutingDataSource for routing, configuring multiple datasources in application.yml, and optionally adding annotation‑driven switching and runtime datasource registration.

AbstractRoutingDataSourceDatabaseDynamicDataSource
0 likes · 15 min read
Implementing Dynamic Data Source Switching in Spring Boot with ThreadLocal and AbstractRoutingDataSource
Top Architect
Top Architect
Apr 12, 2023 · Backend Development

Dynamic Multi‑DataSource Management and Transaction Handling in Spring

This article explains how to dynamically manage multiple data sources and ensure transactional consistency in Spring applications by extending AbstractRoutingDataSource, using configuration‑file or database‑table approaches, applying AOP for datasource switching, and implementing custom multi‑database transaction management.

AOPDynamicDataSourceMultiDatabase
0 likes · 16 min read
Dynamic Multi‑DataSource Management and Transaction Handling in Spring
Top Architect
Top Architect
Apr 10, 2023 · Databases

Dynamic Multi‑DataSource Management and Transaction Handling in Spring

The article explains how to dynamically manage multiple data sources and ensure transaction consistency in Spring applications by extending AbstractRoutingDataSource, using configuration‑file or database‑table approaches, and applying AOP‑based switching with custom transaction management.

AbstractRoutingDataSourceDynamicDataSourceJava
0 likes · 16 min read
Dynamic Multi‑DataSource Management and Transaction Handling in Spring