In my spring mvc application , I have two different MySql database connections. One is for whole data storage and other one is for login history- which insert data daily in a specific period.
I have created two separate Datasource (one via spring.xml and other via configuration class) for jdbcTemplate. Both will created at the time of tomcat start.
- Does creating multiple Datasource (one via spring.xml and other one via @configuration class) in one application is expensive ?
- Will it be better to connect and close (normal jdbc connection) the second database only at the time insertion ?
- Is it bad practice to use both spring.xml and annotation based configuration in one application?
Can someone help me for this?