rzo1 commented on code in PR #1766:
URL: https://github.com/apache/stormcrawler/pull/1766#discussion_r2669759465
##########
external/sql/src/main/java/org/apache/stormcrawler/sql/StatusUpdaterBolt.java:
##########
@@ -253,17 +286,27 @@ private synchronized void checkExecuteBatch() throws
SQLException {
lastInsertBatchTime = System.currentTimeMillis();
currentBatchSize = 0;
waitingAck.clear();
-
- insertPreparedStmt.close();
- insertPreparedStmt = connection.prepareStatement(insertQuery);
}
@Override
public void cleanup() {
Review Comment:
I see your point about making these interfaces extend AutoCloseable for
better resource cleanup and enabling usage with try-with-resources. That
approach makes sense in general for components that are manually managed and
need explicit cleanup.
However, in the case of a Storm bolt, it doesn’t quite fit. Bolts are
executed by the Storm runtime, and users typically don’t instantiate or manage
them directly in a try-with-resources block. Implementing AutoCloseable here
wouldn’t provide any practical benefit, since resource management is handled by
Storm itself rather than the user.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]