-
Notifications
You must be signed in to change notification settings - Fork 994
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
PHOENIX-7316 Need close more Statements #1894
Conversation
1c258d1
to
0f207c8
Compare
PreparedStatement delegateStmt = QueryUtil.getTablesStmt(stmt.getConnection(), null, | ||
getTargetSchema(), getDbPattern(), null); | ||
return ((PhoenixPreparedStatement) delegateStmt).compileQuery(); | ||
try (PreparedStatement delegateStmt = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is suspicious.
We keep using the query plan returned from the closed statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is suspicious. We keep using the query plan returned from the closed statement.
thanks reviewing, rollbacked it.
@@ -304,6 +306,14 @@ public void putMetrics(MetricsRecord record) { | |||
} catch (SQLException e) { | |||
LOGGER.error("Could not write metric: \n" + record + " to prepared statement:\n" + stmt, | |||
e); | |||
} finally { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not a simple try-with-resources ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not a simple try-with-resources ?
changed it.
@@ -238,6 +239,14 @@ private void addToBatch(Span span) { | |||
} catch (SQLException e) { | |||
LOGGER.error("Could not write metric: \n" + span + " to prepared statement:\n" + stmt, | |||
e); | |||
} finally { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not simple try-with-resources?
4051656
to
a81867a
Compare
a81867a
to
ff868ed
Compare
No description provided.