File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,18 @@ public MySQLDB(Supplier<Locale> locale) {
29
29
super (locale );
30
30
}
31
31
32
+ private static synchronized void increment () {
33
+ increment ++;
34
+ }
35
+
36
+ /**
37
+ * @return the name of the Database
38
+ */
39
+ @ Override
40
+ public String getName () {
41
+ return "MySQL" ;
42
+ }
43
+
32
44
/**
33
45
* Setups the {@link HikariDataSource}
34
46
*/
@@ -55,7 +67,7 @@ public void setupDataSource() throws DBInitException {
55
67
56
68
config .setPoolName ("Plan Connection Pool-" + increment );
57
69
config .setDriverClassName ("com.mysql.jdbc.Driver" );
58
- increment ++ ;
70
+ increment () ;
59
71
60
72
config .setAutoCommit (true );
61
73
config .setMaximumPoolSize (8 );
@@ -69,14 +81,6 @@ public void setupDataSource() throws DBInitException {
69
81
}
70
82
}
71
83
72
- /**
73
- * @return the name of the Database
74
- */
75
- @ Override
76
- public String getName () {
77
- return "MySQL" ;
78
- }
79
-
80
84
@ Override
81
85
public Connection getConnection () throws SQLException {
82
86
Connection connection = dataSource .getConnection ();
You can’t perform that action at this time.
0 commit comments