DBZ-1207 MySQL connection timeout after bootstrapping a new table

This commit is contained in:
Joy Gao 2019-04-01 23:34:24 -07:00 committed by Gunnar Morling
parent b90274cc63
commit f3220e9766

View File

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