Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DBZ-4352 verify connection is valid as well as connected #2994

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -394,7 +394,7 @@ public JdbcConnection commit() throws SQLException {
}

public synchronized JdbcConnection rollback() throws SQLException {
if (!isConnected()) {
if (!isValid()) {
return this;
}
Connection conn = connection();
Expand Down Expand Up @@ -887,9 +887,9 @@ public synchronized Connection connection() throws SQLException {
}

public synchronized Connection connection(boolean executeOnConnect) throws SQLException {
if (!isConnected()) {
if (!isValid()) {
conn = factory.connect(JdbcConfiguration.adapt(config));
if (!isConnected()) {
if (!isValid()) {
throw new SQLException("Unable to obtain a JDBC connection");
}
// Always run the initial operations on this new connection
Expand Down
Expand Up @@ -295,7 +295,7 @@ public SQLXML createSQLXML() throws SQLException {

@Override
public boolean isValid(int timeout) throws SQLException {
return false;
return true;
}

@Override
Expand Down