'springapplication.run is creating multiple connected clients

I am doing this:

    final String[] args = new String[0];
    SpringApplication springApplication = new SpringApplication(MianClass.class);
    springApplication.setWebApplicationType(WebApplicationType.NONE);
    ConfigurableApplicationContext applicationContext = springApplication.run(args);

And after last line I see I have created 20 connections to mySQL database. And next when I do some query it use only 1 User.

What could be the reason for creating so many clients?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source