You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The execution of an executeUpdate statement unexpectedly leads to the closure of a previously obtained ResultSet object.
In the provided test case, a ResultSet object is obtained by calling getGeneratedKeys() on a Statement object after executing an UPDATE statement. This ResultSet is expected to remain open for subsequent operations. However, when another executeUpdate is executed on the same Statement object, the previously obtained ResultSet is found to be closed.
The expected behavior is that executing an executeUpdate statement should not affect the state (open or closed) of a previously acquired ResultSet.
@Testpublicvoidtest() throwsSQLException {
Connectioncon;
Statementstmt;
ResultSetrs;
con = DriverManager.getConnection("jdbc:pgsql://localhost:5432/test16?user=user&password=password");
stmt = con.createStatement(1003, 1008, 2);
stmt.executeUpdate("CREATE TABLE table16_0(id REAL PRIMARY KEY,value BIT);");
stmt.executeUpdate("UPDATE table16_0 SET value = 77::bit WHERE id <= 1", 1);
stmt.executeBatch();
rs = stmt.getGeneratedKeys();
System.out.println(rs.isClosed()); // falsestmt.executeUpdate("UPDATE table16_0 SET value = 77::bit WHERE id <= 1", 1);
System.out.println(rs.isClosed()); // truecon.close();
}
The text was updated successfully, but these errors were encountered:
The execution of an executeUpdate statement unexpectedly leads to the closure of a previously obtained ResultSet object.
In the provided test case, a ResultSet object is obtained by calling getGeneratedKeys() on a Statement object after executing an UPDATE statement. This ResultSet is expected to remain open for subsequent operations. However, when another executeUpdate is executed on the same Statement object, the previously obtained ResultSet is found to be closed.
The expected behavior is that executing an executeUpdate statement should not affect the state (open or closed) of a previously acquired ResultSet.
The text was updated successfully, but these errors were encountered: