zstan commented on code in PR #2906:
URL: https://github.com/apache/ignite-3/pull/2906#discussion_r1418776804
##########
modules/jdbc/src/integrationTest/java/org/apache/ignite/jdbc/AbstractJdbcSelfTest.java:
##########
@@ -168,4 +173,20 @@ protected void checkConnectionClosed(Executable ex) {
protected void checkNotSupported(Executable ex) {
assertThrows(SQLFeatureNotSupportedException.class, ex);
}
+
+ /** Return a size of stored resources. Reflection based implementation,
need to be refactored. */
+ int openCursorsRegistered() throws Exception {
+ // a bit hack, instead of calling stmt.close(), gives a chance to
catch potential forgiven cursor.
+ stmt.execute("SELECT 1");
+ ResultSet rs = stmt.getResultSet();
+ rs.close();
Review Comment:
the very first execution of stmt.execute alredy registers a first cursor in
resourses, thus for correct checking resource leakage without this approach i
would need to make one of actions, or call :
1. stmt.close() - but this concrete implementation can work properly well
while sequential .getResultset() can holds a bug.
2. always get last resultset in tests and forcibly close it.
--
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]