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

PHOENIX-7316 Need close more Statements #1894

Closed
wants to merge 0 commits into from

Conversation

chaijunjie0101
Copy link
Contributor

No description provided.

@chaijunjie0101 chaijunjie0101 force-pushed the PHOENIX-7316 branch 2 times, most recently from 1c258d1 to 0f207c8 Compare May 19, 2024 16:08
PreparedStatement delegateStmt = QueryUtil.getTablesStmt(stmt.getConnection(), null,
getTargetSchema(), getDbPattern(), null);
return ((PhoenixPreparedStatement) delegateStmt).compileQuery();
try (PreparedStatement delegateStmt =
Copy link
Contributor

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.

Copy link
Contributor Author

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 {
Copy link
Contributor

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 ?

Copy link
Contributor Author

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 {
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants