You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "lowka (via GitHub)" <gi...@apache.org> on 2025/10/15 06:40:00 UTC
[PR] Ignite 26139 [ignite-3]
lowka opened a new pull request, #6772:
URL: https://github.com/apache/ignite-3/pull/6772
Thank you for submitting the pull request.
To streamline the review process of the patch and ensure better code quality
we ask both an author and a reviewer to verify the following:
### The Review Checklist
- [ ] **Formal criteria:** TC status, codestyle, mandatory documentation. Also make sure to complete the following:
\- There is a single JIRA ticket related to the pull request.
\- The web-link to the pull request is attached to the JIRA ticket.
\- The JIRA ticket has the Patch Available state.
\- The description of the JIRA ticket explains WHAT was made, WHY and HOW.
\- The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
- [ ] **Design:** new code conforms with the design principles of the components it is added to.
- [ ] **Patch quality:** patch cannot be split into smaller pieces, its size must be reasonable.
- [ ] **Code quality:** code is clean and readable, necessary developer documentation is added if needed.
- [ ] **Tests code quality:** test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.
### Notes
- [Apache Ignite Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Java+Code+Style+Guide)
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-26139 Sql. Jdbc. Support non-autocommit mode and cancellation token for use in thin client API. [ignite-3]
Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov commented on code in PR #6772:
URL: https://github.com/apache/ignite-3/pull/6772#discussion_r2431847413
##########
modules/jdbc/src/main/java/org/apache/ignite/internal/jdbc2/JdbcConnection2.java:
##########
@@ -273,6 +324,11 @@ public void commit() throws SQLException {
if (autoCommit) {
throw new SQLException(TRANSACTION_CANNOT_BE_COMMITED_IN_AUTOCOMMIT_MODE);
+ } else {
+ if (transaction == null) {
+ throw new SQLException(NO_TRANSACTION_TO_COMMIT);
+ }
+ finishTx(true);
}
Review Comment:
```suggestion
}
if (transaction == null) {
throw new SQLException(NO_TRANSACTION_TO_COMMIT);
}
finishTx(true);
}
```
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-26139 Sql. Jdbc. Support non-autocommit mode and cancellation token for use in thin client API. [ignite-3]
Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov merged PR #6772:
URL: https://github.com/apache/ignite-3/pull/6772
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-26139 Sql. Jdbc. Support non-autocommit mode and cancellation token for use in thin client API. [ignite-3]
Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov commented on code in PR #6772:
URL: https://github.com/apache/ignite-3/pull/6772#discussion_r2431837208
##########
modules/jdbc/src/main/java/org/apache/ignite/internal/jdbc2/JdbcConnection2.java:
##########
@@ -247,14 +261,51 @@ public String nativeSQL(String sql) throws SQLException {
return sql;
}
+ @Nullable Transaction startTransactionIfNoAutoCommit() {
+ if (transaction == null && !autoCommit) {
+ transaction = igniteClient.transactions().begin(new TransactionOptions().readOnly(false));
+ return transaction;
+ } else {
+ return transaction;
+ }
+ }
+
+ private void finishTx(boolean commit) throws SQLException {
+ try {
+ Transaction tx = this.transaction;
+ if (tx == null) {
+ return;
+ }
+ // Null out the transaction first.
+ this.transaction = null;
+
+ if (commit) {
+ tx.commit();
+ } else {
+ tx.rollback();
+ }
+ } catch (Exception e) {
+ String error = "The transaction " + (commit ? "commit" : "rollback") + " request failed.";
Review Comment:
```suggestion
String error = IgniteStringUtils.format("The transaction {} request failed.", commit ? "commit" : "rollback") ;
```
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-26139 Sql. Jdbc. Support non-autocommit mode and cancellation token for use in thin client API. [ignite-3]
Posted by "lowka (via GitHub)" <gi...@apache.org>.
lowka commented on code in PR #6772:
URL: https://github.com/apache/ignite-3/pull/6772#discussion_r2434614429
##########
modules/jdbc/src/main/java/org/apache/ignite/internal/jdbc2/JdbcConnection2.java:
##########
@@ -247,14 +261,51 @@ public String nativeSQL(String sql) throws SQLException {
return sql;
}
+ @Nullable Transaction startTransactionIfNoAutoCommit() {
+ if (transaction == null && !autoCommit) {
+ transaction = igniteClient.transactions().begin(new TransactionOptions().readOnly(false));
+ return transaction;
+ } else {
+ return transaction;
+ }
+ }
+
+ private void finishTx(boolean commit) throws SQLException {
Review Comment:
I agree. Fixed.
##########
modules/jdbc/src/main/java/org/apache/ignite/internal/jdbc2/JdbcConnection2.java:
##########
@@ -273,6 +324,11 @@ public void commit() throws SQLException {
if (autoCommit) {
throw new SQLException(TRANSACTION_CANNOT_BE_COMMITED_IN_AUTOCOMMIT_MODE);
+ } else {
+ if (transaction == null) {
+ throw new SQLException(NO_TRANSACTION_TO_COMMIT);
+ }
+ finishTx(true);
}
Review Comment:
Fixed.
##########
modules/jdbc/src/main/java/org/apache/ignite/internal/jdbc2/JdbcConnection2.java:
##########
@@ -247,14 +261,51 @@ public String nativeSQL(String sql) throws SQLException {
return sql;
}
+ @Nullable Transaction startTransactionIfNoAutoCommit() {
+ if (transaction == null && !autoCommit) {
+ transaction = igniteClient.transactions().begin(new TransactionOptions().readOnly(false));
+ return transaction;
+ } else {
+ return transaction;
+ }
+ }
+
+ private void finishTx(boolean commit) throws SQLException {
+ try {
+ Transaction tx = this.transaction;
+ if (tx == null) {
+ return;
+ }
+ // Null out the transaction first.
+ this.transaction = null;
+
+ if (commit) {
+ tx.commit();
+ } else {
+ tx.rollback();
+ }
+ } catch (Exception e) {
+ String error = "The transaction " + (commit ? "commit" : "rollback") + " request failed.";
Review Comment:
Fixed.
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-26139 Sql. Jdbc. Support non-autocommit mode and cancellation token for use in thin client API. [ignite-3]
Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov commented on code in PR #6772:
URL: https://github.com/apache/ignite-3/pull/6772#discussion_r2431946885
##########
modules/jdbc/src/main/java/org/apache/ignite/internal/jdbc2/JdbcConnection2.java:
##########
@@ -247,14 +261,51 @@ public String nativeSQL(String sql) throws SQLException {
return sql;
}
+ @Nullable Transaction startTransactionIfNoAutoCommit() {
+ if (transaction == null && !autoCommit) {
+ transaction = igniteClient.transactions().begin(new TransactionOptions().readOnly(false));
+ return transaction;
+ } else {
+ return transaction;
+ }
+ }
+
+ private void finishTx(boolean commit) throws SQLException {
Review Comment:
We always pass a constant to this method.
Maybe better to have 2 ones" commit and rollback?
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-26139 Sql. Jdbc. Support non-autocommit mode and cancellation token for use in thin client API. [ignite-3]
Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov commented on code in PR #6772:
URL: https://github.com/apache/ignite-3/pull/6772#discussion_r2431847413
##########
modules/jdbc/src/main/java/org/apache/ignite/internal/jdbc2/JdbcConnection2.java:
##########
@@ -273,6 +324,11 @@ public void commit() throws SQLException {
if (autoCommit) {
throw new SQLException(TRANSACTION_CANNOT_BE_COMMITED_IN_AUTOCOMMIT_MODE);
+ } else {
+ if (transaction == null) {
+ throw new SQLException(NO_TRANSACTION_TO_COMMIT);
+ }
+ finishTx(true);
}
Review Comment:
```suggestion
}
if (transaction == null) {
throw new SQLException(NO_TRANSACTION_TO_COMMIT);
}
finishTx(true);
```
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-26139 Sql. Jdbc. Support non-autocommit mode and cancellation token for use in thin client API. [ignite-3]
Posted by "lowka (via GitHub)" <gi...@apache.org>.
lowka commented on code in PR #6772:
URL: https://github.com/apache/ignite-3/pull/6772#discussion_r2431487938
##########
modules/spring/spring-data-ignite/src/test/java/org/apache/ignite/data/SpringDataJdbcTest.java:
##########
@@ -71,7 +71,7 @@
*/
@SpringBootTest(classes = TestApplication.class)
@ExtendWith(WorkDirectoryExtension.class)
-@Disabled("https://issues.apache.org/jira/browse/IGNITE-26139")
+@Disabled("https://issues.apache.org/jira/browse/IGNITE-26190")
Review Comment:
Spring Data utilises batches for DML operations.
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org