Skip to content

IGNITE-28649 Support JDBC API for savepoint#13112

Open
vldpyatkov wants to merge 4 commits into
apache:masterfrom
vldpyatkov:ignite-28649
Open

IGNITE-28649 Support JDBC API for savepoint#13112
vldpyatkov wants to merge 4 commits into
apache:masterfrom
vldpyatkov:ignite-28649

Conversation

@vldpyatkov
Copy link
Copy Markdown
Contributor

@zstan
Copy link
Copy Markdown
Contributor

zstan commented May 8, 2026

what about JdbcThinFeature and correct before\after savepoint jdbc vs old\new savepoint cluster correct handling tests ?

stmt.executeUpdate("UPDATE Person SET name = 'Jane' WHERE id = 1");

conn.rollback(savepoint);
conn.releaseSavepoint(savepoint);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from this example is not clear - what was the final state of row name where id = 1, can you extend this test plz ? I suppose pure java: assert expectation would be enough here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a check that it is not possible to roll back on an already rolled back savepoint.

Comment thread docs/_docs/SQL/JDBC/jdbc-driver.adoc Outdated
* `Connection.releaseSavepoint(Savepoint savepoint)`

Savepoints are available for JDBC connections that use the Calcite-based SQL engine and explicit `PESSIMISTIC` transactions.
Disable auto-commit before creating a savepoint.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwize what ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added note:
If auto-commit remains enabled, JDBC savepoint API calls that require an explicit transaction fail with SQLException.


assertQuery(conn, 1, "before_sp1");

conn.releaseSavepoint(sp1);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plz append additional test, from java doc : java.sql.Connection#releaseSavepoint

Any reference to the savepoint after it have been removed will cause an SQLException to be thrown.

thus test like :

Savepoint sp1 = conn.setSavepoint("sp1");

conn.releaseSavepoint(sp1);
conn.rollback(sp1);

need to fail correctly

Probably test org.apache.ignite.jdbc.thin.JdbcThinConnectionSelfTest#testReleaseSavepoint
need to be expanded, i see only null and fake = not exist safePoints been checked there

Comment thread modules/clients/pom.xml Outdated
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants