korlov42 commented on code in PR #1880:
URL: https://github.com/apache/ignite-3/pull/1880#discussion_r1171175558
##########
modules/client-handler/src/test/java/org/apache/ignite/client/handler/JdbcQueryEventHandlerImplTest.java:
##########
@@ -247,6 +252,57 @@ public void singleTxUsedForMultipleOperations() {
verify(queryProcessor, times(5)).querySingleAsync(any(), any(), any(),
any());
}
+ /**
+ * Tests {@link Connection#commit()} method behaviour.
+ *
+ * <p>Calling {@code commit} is expected to throw an exception if called
in auto-commit mode or on a closed connection,
+ *
+ * @throws SQLException If failed.
+ */
+ @Test
+ public void jdbcConnectionCommit() throws Exception {
+ Connection conn = new JdbcConnection(eventHandler, new
ConnectionPropertiesImpl());
+
+ SQLException ex = assertThrows(SQLException.class, conn::commit);
+ assertThat(ex.getMessage(), containsString("Transaction cannot be
committed explicitly in auto-commit mode."));
+
+ conn.setAutoCommit(false);
+ conn.commit();
+
+ verifyNoInteractions(igniteTransactions);
+
+ conn.close();
+
+ // Exception when called on closed connection.
+ assertThrows(SQLException.class, conn::commit);
+ }
+
+ /**
+ * Tests {@link Connection#rollback()} method behaviour.
+ *
+ * <p>Calling {@code rollback} is expected to throw an exception if called
in auto-commit mode or on a closed connection,
+ *
+ * @throws SQLException If failed.
+ */
+ @Test
+ public void jdbcConnectionRollback() throws Exception {
Review Comment:
how tests on JDBC connection relates to jdbc event handler?
--
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]