Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When JDBC Driver enables transactions and auto-commit, multi-threaded deletion will fail #2023

Open
linghengqian opened this issue Dec 16, 2024 · 6 comments
Labels
module-jdbc JDBC driver

Comments

@linghengqian
Copy link

Describe the bug

  • When JDBC Driver enables transactions and auto-commit, multi-threaded deletion will fail.

Steps to reproduce

sdk install java 23-open

git clone [email protected]:linghengqian/clickhouse-acid-delete-test.git
cd ./clickhouse-acid-delete-test/
sdk use java 23-open
./mvnw clean test

Expected behaviour

[INFO] Running io.github.linghengqian.MySqlTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 10.49 s -- in io.github.linghengqian.MySqlTest

Code example

Error log

Click me to view the complete error log🐳🐬🐡🦑🦞🐊🫎🦒
[INFO] Scanning for projects...
[INFO] 
[INFO] ---------< io.github.linghengqian:clickhouse-acid-delete-test >---------
[INFO] Building clickhouse-acid-delete-test 1.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- clean:3.2.0:clean (default-clean) @ clickhouse-acid-delete-test ---
[INFO] Deleting /home/linghengqian/TwinklingLiftWorks/git/public/clickhouse-acid-delete-test/target
[INFO] 
[INFO] --- resources:3.3.1:resources (default-resources) @ clickhouse-acid-delete-test ---
[INFO] skip non existing resourceDirectory /home/linghengqian/TwinklingLiftWorks/git/public/clickhouse-acid-delete-test/src/main/resources
[INFO] 
[INFO] --- compiler:3.13.0:compile (default-compile) @ clickhouse-acid-delete-test ---
[INFO] No sources to compile
[INFO] 
[INFO] --- resources:3.3.1:testResources (default-testResources) @ clickhouse-acid-delete-test ---
[INFO] Copying 2 resources from src/test/resources to target/test-classes
[INFO] 
[INFO] --- compiler:3.13.0:testCompile (default-testCompile) @ clickhouse-acid-delete-test ---
[INFO] Recompiling the module because of changed source code.
[INFO] Compiling 2 source files with javac [debug target 23] to target/test-classes
[INFO] 
[INFO] --- surefire:3.2.5:test (default-test) @ clickhouse-acid-delete-test ---
[INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running io.github.linghengqian.ClickHouseTest
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 6.667 s <<< FAILURE! -- in io.github.linghengqian.ClickHouseTest
[ERROR] io.github.linghengqian.ClickHouseTest.testClickHouse -- Time elapsed: 0.770 s <<< ERROR!
java.lang.RuntimeException: 
java.lang.RuntimeException: java.sql.BatchUpdateException: Code: 341. DB::Exception: Exception happened during execution of mutation 'mutation_14.txt' with part 'all_1_6_1' reason: 'Serialization error: part all_1_6_1 is locked by transaction 4745739302109261907'. This error maybe retryable or not. In case of unretryable error, mutation can be killed with KILL MUTATION query 

0. DB::checkMutationStatus(std::optional<DB::MergeTreeMutationStatus>&, std::set<String, std::less<String>, std::allocator<String>> const&) @ 0x00000000129ef95b
1. DB::StorageMergeTree::waitForMutation(long, String const&, bool) @ 0x0000000012bf9652
2. DB::StorageMergeTree::mutate(DB::MutationCommands const&, std::shared_ptr<DB::Context const>) @ 0x0000000012bfa8cb
3. DB::InterpreterAlterQuery::executeToTable(DB::ASTAlterQuery const&) @ 0x0000000011669699
4. DB::InterpreterAlterQuery::execute() @ 0x000000001166698d
5. DB::executeQueryImpl(char const*, char const*, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum, DB::ReadBuffer*) @ 0x0000000011c7cea6
6. DB::executeQuery(DB::ReadBuffer&, DB::WriteBuffer&, bool, std::shared_ptr<DB::Context>, std::function<void (DB::QueryResultDetails const&)>, DB::QueryFlags, std::optional<DB::FormatSettings> const&, std::function<void (DB::IOutputFormat&, String const&, std::shared_ptr<DB::Context const> const&, std::optional<DB::FormatSettings> const&)>) @ 0x0000000011c812ac
7. DB::HTTPHandler::processQuery(DB::HTTPServerRequest&, DB::HTMLForm&, DB::HTTPServerResponse&, DB::HTTPHandler::Output&, std::optional<DB::CurrentThread::QueryScope>&, StrongTypedef<unsigned long, ProfileEvents::EventTag> const&) @ 0x0000000012e3b092
8. DB::HTTPHandler::handleRequest(DB::HTTPServerRequest&, DB::HTTPServerResponse&, StrongTypedef<unsigned long, ProfileEvents::EventTag> const&) @ 0x0000000012e3f49e
9. DB::HTTPServerConnection::run() @ 0x0000000012ede461
10. Poco::Net::TCPServerConnection::start() @ 0x0000000015d89527
11. Poco::Net::TCPServerDispatcher::run() @ 0x0000000015d899b9
12. Poco::PooledThread::run() @ 0x0000000015d563fc
13. Poco::ThreadImpl::runnableEntry(void*) @ 0x0000000015d5499d
14. ? @ 0x00007f72a6253ac3
15. ? @ 0x00007f72a62e4a04

. (UNFINISHED) (version 24.11.1.2557 (official build))

        at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:501)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:485)
        at java.base/java.util.concurrent.ForkJoinTask.getException(ForkJoinTask.java:555)
        at java.base/java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:573)
        at java.base/java.util.concurrent.ForkJoinTask.join(ForkJoinTask.java:663)
        at java.base/java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:677)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:160)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfInt.evaluateParallel(ForEachOps.java:189)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:264)
        at java.base/java.util.stream.IntPipeline.forEach(IntPipeline.java:466)
        at java.base/java.util.stream.IntPipeline$Head.forEach(IntPipeline.java:623)
        at io.github.linghengqian.ClickHouseTest.testClickHouse(ClickHouseTest.java:107)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
Caused by: java.lang.RuntimeException: java.sql.BatchUpdateException: Code: 341. DB::Exception: Exception happened during execution of mutation 'mutation_14.txt' with part 'all_1_6_1' reason: 'Serialization error: part all_1_6_1 is locked by transaction 4745739302109261907'. This error maybe retryable or not. In case of unretryable error, mutation can be killed with KILL MUTATION query 

0. DB::checkMutationStatus(std::optional<DB::MergeTreeMutationStatus>&, std::set<String, std::less<String>, std::allocator<String>> const&) @ 0x00000000129ef95b
1. DB::StorageMergeTree::waitForMutation(long, String const&, bool) @ 0x0000000012bf9652
2. DB::StorageMergeTree::mutate(DB::MutationCommands const&, std::shared_ptr<DB::Context const>) @ 0x0000000012bfa8cb
3. DB::InterpreterAlterQuery::executeToTable(DB::ASTAlterQuery const&) @ 0x0000000011669699
4. DB::InterpreterAlterQuery::execute() @ 0x000000001166698d
5. DB::executeQueryImpl(char const*, char const*, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum, DB::ReadBuffer*) @ 0x0000000011c7cea6
6. DB::executeQuery(DB::ReadBuffer&, DB::WriteBuffer&, bool, std::shared_ptr<DB::Context>, std::function<void (DB::QueryResultDetails const&)>, DB::QueryFlags, std::optional<DB::FormatSettings> const&, std::function<void (DB::IOutputFormat&, String const&, std::shared_ptr<DB::Context const> const&, std::optional<DB::FormatSettings> const&)>) @ 0x0000000011c812ac
7. DB::HTTPHandler::processQuery(DB::HTTPServerRequest&, DB::HTMLForm&, DB::HTTPServerResponse&, DB::HTTPHandler::Output&, std::optional<DB::CurrentThread::QueryScope>&, StrongTypedef<unsigned long, ProfileEvents::EventTag> const&) @ 0x0000000012e3b092
8. DB::HTTPHandler::handleRequest(DB::HTTPServerRequest&, DB::HTTPServerResponse&, StrongTypedef<unsigned long, ProfileEvents::EventTag> const&) @ 0x0000000012e3f49e
9. DB::HTTPServerConnection::run() @ 0x0000000012ede461
10. Poco::Net::TCPServerConnection::start() @ 0x0000000015d89527
11. Poco::Net::TCPServerDispatcher::run() @ 0x0000000015d899b9
12. Poco::PooledThread::run() @ 0x0000000015d563fc
13. Poco::ThreadImpl::runnableEntry(void*) @ 0x0000000015d5499d
14. ? @ 0x00007f72a6253ac3
15. ? @ 0x00007f72a62e4a04

. (UNFINISHED) (version 24.11.1.2557 (official build))

        at io.github.linghengqian.ClickHouseTest.lambda$testClickHouse$2(ClickHouseTest.java:113)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfInt.accept(ForEachOps.java:205)
        at java.base/java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Streams.java:104)
        at java.base/java.util.Spliterator$OfInt.forEachRemaining(Spliterator.java:712)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:570)
        at java.base/java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:291)
        at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:759)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:507)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1458)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2034)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:189)
Caused by: java.sql.BatchUpdateException: Code: 341. DB::Exception: Exception happened during execution of mutation 'mutation_14.txt' with part 'all_1_6_1' reason: 'Serialization error: part all_1_6_1 is locked by transaction 4745739302109261907'. This error maybe retryable or not. In case of unretryable error, mutation can be killed with KILL MUTATION query 

0. DB::checkMutationStatus(std::optional<DB::MergeTreeMutationStatus>&, std::set<String, std::less<String>, std::allocator<String>> const&) @ 0x00000000129ef95b
1. DB::StorageMergeTree::waitForMutation(long, String const&, bool) @ 0x0000000012bf9652
2. DB::StorageMergeTree::mutate(DB::MutationCommands const&, std::shared_ptr<DB::Context const>) @ 0x0000000012bfa8cb
3. DB::InterpreterAlterQuery::executeToTable(DB::ASTAlterQuery const&) @ 0x0000000011669699
4. DB::InterpreterAlterQuery::execute() @ 0x000000001166698d
5. DB::executeQueryImpl(char const*, char const*, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum, DB::ReadBuffer*) @ 0x0000000011c7cea6
6. DB::executeQuery(DB::ReadBuffer&, DB::WriteBuffer&, bool, std::shared_ptr<DB::Context>, std::function<void (DB::QueryResultDetails const&)>, DB::QueryFlags, std::optional<DB::FormatSettings> const&, std::function<void (DB::IOutputFormat&, String const&, std::shared_ptr<DB::Context const> const&, std::optional<DB::FormatSettings> const&)>) @ 0x0000000011c812ac
7. DB::HTTPHandler::processQuery(DB::HTTPServerRequest&, DB::HTMLForm&, DB::HTTPServerResponse&, DB::HTTPHandler::Output&, std::optional<DB::CurrentThread::QueryScope>&, StrongTypedef<unsigned long, ProfileEvents::EventTag> const&) @ 0x0000000012e3b092
8. DB::HTTPHandler::handleRequest(DB::HTTPServerRequest&, DB::HTTPServerResponse&, StrongTypedef<unsigned long, ProfileEvents::EventTag> const&) @ 0x0000000012e3f49e
9. DB::HTTPServerConnection::run() @ 0x0000000012ede461
10. Poco::Net::TCPServerConnection::start() @ 0x0000000015d89527
11. Poco::Net::TCPServerDispatcher::run() @ 0x0000000015d899b9
12. Poco::PooledThread::run() @ 0x0000000015d563fc
13. Poco::ThreadImpl::runnableEntry(void*) @ 0x0000000015d5499d
14. ? @ 0x00007f72a6253ac3
15. ? @ 0x00007f72a62e4a04

. (UNFINISHED) (version 24.11.1.2557 (official build))

        at com.clickhouse.jdbc.SqlExceptionUtils.batchUpdateError(SqlExceptionUtils.java:107)
        at com.clickhouse.jdbc.internal.SqlBasedPreparedStatement.executeAny(SqlBasedPreparedStatement.java:223)
        at com.clickhouse.jdbc.internal.SqlBasedPreparedStatement.executeLargeUpdate(SqlBasedPreparedStatement.java:302)
        at com.clickhouse.jdbc.internal.AbstractPreparedStatement.executeUpdate(AbstractPreparedStatement.java:135)
        at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
        at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
        at io.github.linghengqian.ClickHouseTest.lambda$testClickHouse$2(ClickHouseTest.java:111)
        ... 10 more

[INFO] Running io.github.linghengqian.MySqlTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 10.49 s -- in io.github.linghengqian.MySqlTest
[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Errors: 
[ERROR]   ClickHouseTest.testClickHouse:107 » Runtime java.lang.RuntimeException: java.sql.BatchUpdateException: Code: 341. DB::Exception: Exception happened during execution of mutation 'mutation_14.txt' with part 'all_1_6_1' reason: 'Serialization error: part all_1_6_1 is locked by transaction 4745739302109261907'. This error maybe retryable or not. In case of unretryable error, mutation can be killed with KILL MUTATION query 

0. DB::checkMutationStatus(std::optional<DB::MergeTreeMutationStatus>&, std::set<String, std::less<String>, std::allocator<String>> const&) @ 0x00000000129ef95b
1. DB::StorageMergeTree::waitForMutation(long, String const&, bool) @ 0x0000000012bf9652
2. DB::StorageMergeTree::mutate(DB::MutationCommands const&, std::shared_ptr<DB::Context const>) @ 0x0000000012bfa8cb
3. DB::InterpreterAlterQuery::executeToTable(DB::ASTAlterQuery const&) @ 0x0000000011669699
4. DB::InterpreterAlterQuery::execute() @ 0x000000001166698d
5. DB::executeQueryImpl(char const*, char const*, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum, DB::ReadBuffer*) @ 0x0000000011c7cea6
6. DB::executeQuery(DB::ReadBuffer&, DB::WriteBuffer&, bool, std::shared_ptr<DB::Context>, std::function<void (DB::QueryResultDetails const&)>, DB::QueryFlags, std::optional<DB::FormatSettings> const&, std::function<void (DB::IOutputFormat&, String const&, std::shared_ptr<DB::Context const> const&, std::optional<DB::FormatSettings> const&)>) @ 0x0000000011c812ac
7. DB::HTTPHandler::processQuery(DB::HTTPServerRequest&, DB::HTMLForm&, DB::HTTPServerResponse&, DB::HTTPHandler::Output&, std::optional<DB::CurrentThread::QueryScope>&, StrongTypedef<unsigned long, ProfileEvents::EventTag> const&) @ 0x0000000012e3b092
8. DB::HTTPHandler::handleRequest(DB::HTTPServerRequest&, DB::HTTPServerResponse&, StrongTypedef<unsigned long, ProfileEvents::EventTag> const&) @ 0x0000000012e3f49e
9. DB::HTTPServerConnection::run() @ 0x0000000012ede461
10. Poco::Net::TCPServerConnection::start() @ 0x0000000015d89527
11. Poco::Net::TCPServerDispatcher::run() @ 0x0000000015d899b9
12. Poco::PooledThread::run() @ 0x0000000015d563fc
13. Poco::ThreadImpl::runnableEntry(void*) @ 0x0000000015d5499d
14. ? @ 0x00007f72a6253ac3
15. ? @ 0x00007f72a62e4a04

. (UNFINISHED) (version 24.11.1.2557 (official build))

[INFO] 
[ERROR] Tests run: 2, Failures: 0, Errors: 1, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  19.853 s
[INFO] Finished at: 2024-12-16T10:02:53+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.2.5:test (default-test) on project clickhouse-acid-delete-test: 
[ERROR] 
[ERROR] Please refer to /home/linghengqian/TwinklingLiftWorks/git/public/clickhouse-acid-delete-test/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Configuration

Environment

  • Client version: 0.7.1-patch1
  • Language version: If this refers to JDK, it's OpenJDK 23
  • OS: Ubuntu 22.04.4

ClickHouse server

  • ClickHouse Server version: 24.11.1.2557
  • ClickHouse Server non-default settings, if any:
  • CREATE TABLE statements for tables involved:
create table IF NOT EXISTS t_order (
    order_id   Int64 NOT NULL DEFAULT rand(),
    order_type Int32,
    user_id    Int32 NOT NULL,
    address_id Int64 NOT NULL,
    status     VARCHAR(50)
) engine = MergeTree
      primary key (order_id)
      order by (order_id)
  • Maybe not, the unit tests create containers via testcontainers-java.
@chernser
Copy link
Contributor

Good day, @linghengqian !
Thank you for reporting!

@chernser chernser self-assigned this Dec 20, 2024
@chernser chernser removed their assignment Jan 10, 2025
@linghengqian
Copy link
Author

jdbc-v2 - Removed support for Transaction Support. Early versions of the driver only simulated transaction support, which could have unexpected results.
  • But I can still access the documentation at https://clickhouse.com/docs/en/guides/developer/transactional normally. What does this mean? Does this mean that ClickHouse now supports SQL execution with similar Table Rollback functionality, just like the Iceberg Table on HiveServer2, but the JDBC Driver does not provide adaptation for Java Connection?

@chernser
Copy link
Contributor

@linghengqian
new JDBC v2 doesn't support transactions right now because transactions are still experimental feature (https://clickhouse.com/docs/en/guides/developer/transactional#transactions-commit-and-rollback).
It may happen in the future that we add support to client and JDBC driver.

@chernser chernser removed the bug label Jan 27, 2025
@linghengqian
Copy link
Author

Thanks for your explanation, should I close the current issue? I don't think I know how to fix the current issue, since it's a bug on jdbc v1.

@chernser
Copy link
Contributor

Hi, @linghengqian !
I will close the issue.
Would please answer a few questions about your use-case?

  • Is multi-threaded deletion expected by design or is a performance optimization?
  • what isolation level of transactions is expected?

Thanks!

@linghengqian
Copy link
Author

Is multi-threaded deletion expected by design or is a performance optimization?

@chernser

  • The failure of multi-threaded deletion is actually just a peculiar phenomenon found in the integration test of Apache ShardingSphere. I personally would not write code like this...
  • To make a long story short, the unit test of shardingsphere expects to create multiple JDBC connections with different databases to the same ClickHouse instance. Then execute SQL similar to the following in different JDBC connections in parallel.
create table IF NOT EXISTS t_order
(
    order_id   Int64 NOT NULL,
    order_type Int32,
    user_id    Int32 NOT NULL,
    address_id Int64 NOT NULL,
    status     VARCHAR(50)
) engine = MergeTree
      primary key (order_id)
      order by (order_id);

TRUNCATE TABLE t_order;

-- Here, about `30` insert SQL statements will be executed.
INSERT INTO t_order (order_id, user_id, order_type, address_id, status) VALUES (?, ?, ?, ?, ?);

SELECT * FROM t_order;

-- Here, about `30` delete SQL statements will be executed. And the exception described in the current issue occurs here. I had to resort to `Awaitility.await().pollDelay(Duration.ofSeconds(5L)).until(() -> true);`.
alter table t_order delete where order_id=?;

what isolation level of transactions is expected?

  • ShardingSphere's unit test actually does not focus on the isolation level, because this is easily affected by third-party frameworks. For example, Apache Seata's distributed transaction framework, its AT Mode does not even support setting isolation levels, causing ShardingSphere to actively ignore some content.
  • The unit test of ShardingSphere basically only cares about whether the logic like the following can run normally. This test transaction logic has no problem for com.clickhouse:clickhouse-jdbc:0.6.3. com.clickhouse:clickhouse-jdbc:0.6.3 is currently the last ClickHouse JDBC Driver version that supports JDK8 runtime, and ShardingSphere has to use it. In other words, ShardingSphere's unit test only focuses on what ClickHouse JDBC Driver does, not what ClickHouse server does.
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
@SuppressWarnings("SqlNoDataSourceInspection")
public class ExampleUtils {
    public void test(DataSource dataSource) throws SQLException {
        try (Connection connection = dataSource.getConnection()) {
            try {
                connection.setAutoCommit(false);
                connection.createStatement().executeUpdate("INSERT INTO t_order (order_id, user_id, order_type, address_id, status) VALUES (2024, 2024, 0, 13800000001, 'INSERT_TEST')");
                connection.createStatement().executeUpdate("INSERT INTO t_order_does_not_exist (test_id_does_not_exist) VALUES (2024)");
                connection.commit();
            } catch (final SQLException ignored) {
                connection.rollback();
            } finally {
                connection.setAutoCommit(true);
            }
        }
        try (Connection conn = dataSource.getConnection();
             ResultSet resultSet = conn.createStatement().executeQuery("SELECT * FROM t_order_item WHERE user_id = 2024")) {
            assertThat(resultSet.next(), is(false));
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module-jdbc JDBC driver
Projects
None yet
Development

No branches or pull requests

2 participants