Curious about the future of data-driven systems? Join our Data Engineering roundtable and learn how to build scalable data platforms.
Data Engineering: The industry has come a long way from organizing unstructured data to adopting today's modern data pipelines. See how.
Software Engineer at Expedia Inc.
Delhi, IN
Joined May 2012
Stats
| Reputation: | 101 |
| Pageviews: | 62.5K |
| Articles: | 2 |
| Comments: | 2 |
Comments
Aug 05, 2018 · Priya Aggarwal
Using component changes order of bean initialization. The classes marked with @Component, @Service, @Repository are initialized before bean definitions declared using @bean.
In this case, the class having dependency on connections using multiple drivers was made a @component , because of this the issue surfaced.
Before this change (when it was a @Bean), the initialization was based on definition order of @Bean method in java file and by that time database driver classes were already initialized because of other beans.
Jul 27, 2018 · Priya Aggarwal
Conclusion is that you should not try to create connections using multiple JDBC drivers concurrently until Java fixes DriverManager class to not use Service Locator in its static initializer