Open schauder opened 3 weeks ago
Since I was able to reproduce this directly with JDBC I opened an issue with HSQLDB: https://sourceforge.net/p/hsqldb/bugs/1725/
Somehow the ResultSet
used for returning generated values is based on a closed cursor on the second attempt.
Code for reproduction:
@Test
@Order(1)
void dsOne() {
insertDataSource();
}
@Test
@Order(2)
void dsTwo() {
insertDataSource();
}
private void insertDataSource() {
try (Connection connection = dataSource.getConnection()) {
PreparedStatement preparedStatement = connection.prepareStatement(INSERT_MAIN + "(?, ?)", Statement.RETURN_GENERATED_KEYS);
preparedStatement.setInt(1, 4711);
preparedStatement.setString(2, "text1");
preparedStatement.executeUpdate();
try (ResultSet resultSet = preparedStatement.getGeneratedKeys()) {
while (resultSet.next()) {
System.out.println("rs element");
}
}
} catch (SQLException ex) {
throw new RuntimeException(ex);
}
}
Simply upgrading the version property leads to
and similar