File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
application-sql/src/main/java/ru/art/sql/module Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 40
40
import static ru .art .sql .constants .SqlModuleConstants .LoggingMessages .*;
41
41
import static ru .art .sql .constants .SqlModuleConstants .*;
42
42
import javax .sql .DataSource ;
43
+ import java .sql .*;
43
44
import java .util .function .*;
44
45
45
46
@ Getter
@@ -83,7 +84,8 @@ private void initializeConnectionPool(SqlDbConfiguration configuration) {
83
84
dataSource = new HikariDataSource (configuration .getHikariPoolConfig ());
84
85
sqlModuleState ().hikariDataSource (dataSource );
85
86
if (sqlModule ().getInitializationMode () == BOOTSTRAP ) {
86
- dataSource .getConnection ();
87
+ try (Connection ignored = dataSource .getConnection ()) {
88
+ }
87
89
getLogger ().info (format (STARING_POOL , dataSource ));
88
90
}
89
91
break ;
@@ -96,7 +98,8 @@ private void initializeConnectionPool(SqlDbConfiguration configuration) {
96
98
if (configuration .isEnableMetrics ()) {
97
99
Caster .<ManagedPooledDataSource >cast (dataSource ).start ();
98
100
}
99
- dataSource .getConnection ();
101
+ try (Connection ignored = dataSource .getConnection ()) {
102
+ }
100
103
getLogger ().info (format (STARING_POOL , dataSource ));
101
104
}
102
105
break ;
You can’t perform that action at this time.
0 commit comments