From 44b357943b66d058aecff0b0a00ff08bd83c3f9e Mon Sep 17 00:00:00 2001 From: Zhichun Wu Date: Thu, 28 Jul 2022 22:59:47 +0800 Subject: [PATCH 1/2] Update latest version --- README.md | 4 ++-- clickhouse-cli-client/README.md | 2 +- clickhouse-client/README.md | 2 +- clickhouse-jdbc/README.md | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6210cd9f1..c075741f2 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ Note: in general, the new driver(v0.3.2) is a few times faster with less memory com.clickhouse clickhouse-http-client - 0.3.2-patch10 + 0.3.2-patch11 ``` @@ -100,7 +100,7 @@ try (ClickHouseClient client = ClickHouseClient.newInstance(ClickHouseProtocol.H com.clickhouse clickhouse-jdbc - 0.3.2-patch10 + 0.3.2-patch11 all diff --git a/clickhouse-cli-client/README.md b/clickhouse-cli-client/README.md index 564b332ca..3a575fe58 100644 --- a/clickhouse-cli-client/README.md +++ b/clickhouse-cli-client/README.md @@ -21,7 +21,7 @@ Either [clickhouse](https://clickhouse.com/docs/en/interfaces/cli/) or [docker]( com.clickhouse clickhouse-cli-client - 0.3.2-patch10 + 0.3.2-patch11 ``` diff --git a/clickhouse-client/README.md b/clickhouse-client/README.md index 01bca3da9..ddd00cf2a 100644 --- a/clickhouse-client/README.md +++ b/clickhouse-client/README.md @@ -38,7 +38,7 @@ client.connect("http://localhost/system") com.clickhouse clickhouse-http-client - 0.3.2-patch10 + 0.3.2-patch11 ``` diff --git a/clickhouse-jdbc/README.md b/clickhouse-jdbc/README.md index 4f4a7a72b..6b78ba52f 100644 --- a/clickhouse-jdbc/README.md +++ b/clickhouse-jdbc/README.md @@ -11,7 +11,7 @@ Keep in mind that `clickhouse-jdbc` is synchronous, and in general it has more o com.clickhouse clickhouse-jdbc - 0.3.2-patch10 + 0.3.2-patch11 all @@ -300,7 +300,7 @@ Please refer to cheatsheet below to upgrade JDBC driver to 0.3.2.
<dependency>
     <groupId>com.clickhouse</groupId>
     <artifactId>clickhouse-jdbc</artifactId>
-    <version>0.3.2-patch10</version>
+    <version>0.3.2-patch11</version>
     <classifier>all</classifier>
     <exclusions>
         <exclusion>

From 4f3bfb01b6f3e7095f459f6f0ddbf75270444733 Mon Sep 17 00:00:00 2001
From: Zhichun Wu 
Date: Thu, 28 Jul 2022 23:01:34 +0800
Subject: [PATCH 2/2] Deprecate method executeWithinTransaction(boolean)

---
 .../clickhouse/client/ClickHouseRequest.java  | 38 +++++++++++++------
 1 file changed, 27 insertions(+), 11 deletions(-)

diff --git a/clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseRequest.java b/clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseRequest.java
index a3d787cde..2a2c7fa82 100644
--- a/clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseRequest.java
+++ b/clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseRequest.java
@@ -1973,20 +1973,36 @@ public ClickHouseResponse executeAndWait() throws ClickHouseException {
     }
 
     /**
-     * Executes the request within a transaction, wait until it's completed and
-     * the transaction being committed or rolled back. The transaction here is
-     * either an implicit transaction(using {@code implicit_transaction} server
-     * setting, with less overhead but requiring 22.7+) or auto-commit
-     * transaction(using clone of this request), depending on argument
-     * {@code useImplicitTransaction}.
-     *
-     * @param useImplicitTransaction use {@code implicit_transaction} server setting
-     *                               with minimum overhead(no session on server side
-     *                               and no additional objects on client side), or
-     *                               an auto-commit {@link ClickHouseTransaction}
+     * Executes the request within an implicit transaction. New transaction will be
+     * always created and started right before the query, and it will be committed
+     * or rolled back afterwards automatically.
+     * 
+     * @return non-null response
+     * @throws ClickHouseException when error occurred during execution
+     */
+    public ClickHouseResponse executeWithinTransaction() throws ClickHouseException {
+        return executeWithinTransaction(false);
+    }
+
+    /**
+     * Executes the request within an implicit transaction. When
+     * {@code useImplicitTransaction} is set to {@code true}, it enforces the client
+     * to use {@code implicit_transaction} setting which is only available in
+     * ClickHouse 22.7+. Otherwise, new transaction will be always created and
+     * started right before the query, and it will be committed or rolled back
+     * afterwards automatically.
+     *
+     * @param useImplicitTransaction {@code true} to use native implicit transaction
+     *                               requiring ClickHouse 22.7+ with minimum
+     *                               overhead(no session on server side and no
+     *                               additional objects on client side); false to
+     *                               use auto-commit transaction
      * @return non-null response
      * @throws ClickHouseException when error occurred during execution
+     * @deprecated will be removed in the future, once the minimum supported version
+     *             of ClickHouse is 22.7 or above
      */
+    @Deprecated
     public ClickHouseResponse executeWithinTransaction(boolean useImplicitTransaction) throws ClickHouseException {
         if (useImplicitTransaction) {
             return set(ClickHouseTransaction.SETTING_IMPLICIT_TRANSACTION, 1).transaction(null).executeAndWait();