mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-05-10 07:07:46 +08:00
fix lock bug
This commit is contained in:
@@ -50,10 +50,10 @@ public class DynamicDataSourceProxy implements DynamicDataSource {
|
||||
public DatabaseType getType() {
|
||||
if (databaseType == null) {
|
||||
lock.lock();
|
||||
if (databaseType != null) {
|
||||
return databaseType;
|
||||
}
|
||||
try {
|
||||
if (databaseType != null) {
|
||||
return databaseType;
|
||||
}
|
||||
try (Connection connection = proxy.getConnection()) {
|
||||
databaseType = DatabaseType.fromJdbcUrl(connection.getMetaData().getURL());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user