Method for realizing database dynamic switching and computer readable storage medium
A storage medium and database technology, applied in database design/maintenance, database management system, structured data retrieval, etc., can solve problems such as thread insecurity, thread non-ownership, multi-thread concurrency insecurity, etc., so that performance is not affected. , to achieve the effect of read-write separation
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment Construction
[0036] Such as figure 1 As shown, the present invention relies on the annotation mechanism of SpringBoot to design a set of annotations, complete the dynamic database connection pool structure, and inject it into the Spring context. The dynamic data source determines which data source to use by obtaining the data source name of the local thread copy. At the same time, through the principle of aspect programming, the business layer uses annotations to parse out the name of the data source configured on the calling method and store it in the local thread copy.
[0037] Data source configuration: application.yml is the default configuration file of SpringBoot. We use the style of SpringBoot to configure the database architecture of Master-Slaves and support multiple Slave nodes;
[0038] Initialize the data source: According to the data source configuration items and different database addresses, different database connection pools are formed and called when needed;
[0039] Def...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com