Problems with transactions in Apache Doris 3 #50590
Unanswered
luibarcap
asked this question in
A - General / Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Apache Doris 3.0.4
JDBC Driver Mysql v8.2.0
We have a Java app that interfaces with Doris through the MySQL JDBC driver (v8.2.0). We are experiencing several issues related to transaction management with the JDBC driver.
Despite disabling autocommit (connection.setAutoCommit(false)), invoking rollback in case of an exception, the data is still saved in the database and the rollback has no effect. We resolved this by explicitly executing the "BEGIN" command (statement.execute("BEGIN")).
According to the documentation, it seems possible to execute multiple INSERTs into different tables of the same schema within a single transaction (insert into values). Executing the inserts via the JDBC driver within the same transaction but through different statements
(e.g., statement.execute("BEGIN"); statement.executeUpdate("INSERT INTO tbl1 VALUES ..."); statement.executeUpdate("INSERT INTO tbl2 VALUES ..."); connection.commit();)
we encounter this error: "There are schema changes in one transaction, you can commit this transaction with formal data or rollback this whole transaction."
Executing the same code in DBeaver (with the same JDBC driver) in a single SQL statement without autocommit works for both commit and rollback:
BEGIN; INSERT INTO tbl1 ....; INSERT INTO tbl2 ....; ROLLBACK;
BEGIN; INSERT INTO tbl1 ....; INSERT INTO tbl2 ....; COMMIT;
I imagine these issues are related to the use of the MySQL JDBC driver.
Is this a known problem? Is there a way to resolve it?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions