Skip to content

Run executeBatch in a single transaction#213

Merged
staticlibs merged 1 commit intoduckdb:mainfrom
staticlibs:stmt_batch
May 7, 2025
Merged

Run executeBatch in a single transaction#213
staticlibs merged 1 commit intoduckdb:mainfrom
staticlibs:stmt_batch

Conversation

@staticlibs
Copy link
Collaborator

This change makes executeBatch() method to be run in a single transaction when auto-commit is enabled. When auto-commit is disabled, the logic remains the same as before.

Testing: new tests added to check auto-commit and rollback behaviour of executeBatch().

This change makes `executeBatch()` method to be run in a single
transaction when auto-commit is enabled. When auto-commit is disabled,
the logic remains the same as before.

Testing: new tests added to check auto-commit and rollback behaviour
of `executeBatch()`.
@staticlibs staticlibs merged commit f647a9f into duckdb:main May 7, 2025
8 checks passed
@staticlibs staticlibs deleted the stmt_batch branch May 7, 2025 00:00
staticlibs added a commit to staticlibs/duckdb-java that referenced this pull request Jun 13, 2025
This change fixes the problem when connection is left in inconsistent
state when `executeBatch` throws constraint (or some other) error with
auto-commit enabled.

In duckdb#213 `executeBatch` was changed to effectively disable auto-commit
for the whole batch. In this case the rollback on error needs to be
handled inside `executeBatch` too.

Testing: new tests added that cover constrain violation with
`executeBatch`.

Fixes: duckdb#259
staticlibs added a commit that referenced this pull request Jun 14, 2025
This change fixes the problem when connection is left in inconsistent
state when `executeBatch` throws constraint (or some other) error with
auto-commit enabled.

In #213 `executeBatch` was changed to effectively disable auto-commit
for the whole batch. In this case the rollback on error needs to be
handled inside `executeBatch` too.

Testing: new tests added that cover constrain violation with
`executeBatch`.

Fixes: #259
staticlibs added a commit to staticlibs/duckdb-java that referenced this pull request Jun 15, 2025
This is a backport of the PR duckdb#261 to `v1.3-ossivalis` stable branch.

This change fixes the problem when connection is left in inconsistent
state when `executeBatch` throws constraint (or some other) error with
auto-commit enabled.

In duckdb#213 `executeBatch` was changed to effectively disable auto-commit
for the whole batch. In this case the rollback on error needs to be
handled inside `executeBatch` too.

Testing: new tests added that cover constrain violation with
`executeBatch`.

Fixes: duckdb#259
staticlibs added a commit that referenced this pull request Jun 16, 2025
This is a backport of the PR #261 to `v1.3-ossivalis` stable branch.

This change fixes the problem when connection is left in inconsistent
state when `executeBatch` throws constraint (or some other) error with
auto-commit enabled.

In #213 `executeBatch` was changed to effectively disable auto-commit
for the whole batch. In this case the rollback on error needs to be
handled inside `executeBatch` too.

Testing: new tests added that cover constrain violation with
`executeBatch`.

Fixes: #259
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.

1 participant