fix lock bug

This commit is contained in:
zhouhao
2017-12-21 10:21:02 +08:00
parent c8f203b9ee
commit 28faead467

View File

@@ -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());
}