Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/main/core-api/java/com/mysql/cj/util/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,9 @@ public static <T> List<T> loadClasses(String extensionClassNames, String errorMe
* @return boolean
*/
public static boolean isJdbcInterface(Class<?> clazz) {
if (Util.isJdbcInterfaceCache.containsKey(clazz)) {
return (Util.isJdbcInterfaceCache.get(clazz));
final Boolean isJdbcInterface = Util.isJdbcInterfaceCache.get(clazz);
if (isJdbcInterface != null) {
return isJdbcInterface;
}

if (clazz.isInterface()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,14 @@
import java.util.Map;
import java.util.Objects;
import java.util.Properties;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Supplier;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
* A {@link IConnectionPlugin} implementation that provides cluster-aware failover
Expand All @@ -92,22 +96,26 @@ public class FailoverConnectionPlugin implements IConnectionPlugin {
static final String METHOD_CLOSE = "close";
static final String METHOD_IS_CLOSED = "isClosed";

private static final List<String> METHODS_REQUIRE_UPDATED_TOPOLOGY = new ArrayList<>(Arrays.asList(
METHOD_COMMIT,
"connect",
"isValid",
"rollback",
"setAutoCommit",
"setReadOnly",
"execute",
"executeBatch",
"executeLargeBatch",
"executeLargeUpdate",
"executeQuery",
"executeUpdate",
"executeWithFlags",
"getParameterMetaData"
));
private final static Set<String> METHODS_REQUIRE_UPDATED_TOPOLOGY = ConcurrentHashMap.newKeySet();

static {
METHODS_REQUIRE_UPDATED_TOPOLOGY.addAll(Arrays.asList(
METHOD_COMMIT,
"connect",
"isValid",
"rollback",
"setAutoCommit",
"setReadOnly",
"execute",
"executeBatch",
"executeLargeBatch",
"executeLargeUpdate",
"executeQuery",
"executeUpdate",
"executeWithFlags",
"getParameterMetaData"
));
}

private static final String METHOD_GET_TRANSACTION_ISOLATION =
"getTransactionIsolation";
Expand Down