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

Prevent Oracle from committing uncommitted transactions on connection close #45301

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

gsmet
Copy link
Member

@gsmet gsmet commented Dec 27, 2024

When a connection is closed, Oracle will commit the unfinished business, which is a very surprising behavior in most cases and could lead to data loss.

I added a -Dquarkus-oracle-no-automatic-rollback-on-connection-close to disable this behavior if absolutely needed.

If we have feedback that this is not something we should do always, we can add a proper configuration property (with a default value to determine).

Fixes #36265

Wouldn't have been possible without the nice work of @segersb and @Felk.

… close

When a connection is closed, Oracle will commit the unfinished business,
which is a very surprising behavior in most cases and could lead to data
loss.

I added a -Dquarkus-oracle-no-automatic-rollback-on-connection-close to
disable this behavior if absolutely needed.

If we have feedback that this is not something we should do always, we
can add a proper configuration property (with a default value to
determine).

Fixes quarkusio#36265

Wouldn't have been possible without the nice work of @segersb and @Felk.

Co-authored-by: Felix König <[email protected]>
@quarkus-bot quarkus-bot bot added area/docstyle issues related for manual docstyle review area/documentation area/jdbc Issues related to the JDBC extensions labels Dec 27, 2024

This comment has been minimized.

Copy link

github-actions bot commented Dec 27, 2024

🎊 PR Preview 35ccb2e has been successfully built and deployed to https://quarkus-pr-main-45301-preview.surge.sh/version/main/guides/

  • Images of blog posts older than 3 months are not available.
  • Newsletters older than 3 months are not available.

This comment has been minimized.

@gsmet gsmet requested a review from yrodiere December 28, 2024 09:56
@gsmet
Copy link
Member Author

gsmet commented Dec 28, 2024

Let's make sure @yrodiere is on board with this before merging. It obviously will require a note in the migration guide.

Copy link
Member

@yrodiere yrodiere left a comment

Choose a reason for hiding this comment

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

Thanks for taking care of this.

LGTM, just a few comments that can probably be dismissed if you disagree.

docs/src/main/asciidoc/datasource.adoc Outdated Show resolved Hide resolved
docs/src/main/asciidoc/datasource.adoc Outdated Show resolved Hide resolved
return;
}

oracleConnection.rollback();
Copy link
Member

Choose a reason for hiding this comment

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

I understand that rolling back a transaction that was already committed will just do nothing, but I wonder if it could mess with metrics... Maybe an if (transaction in progress) -- if possible at all -- would be safer?

docs/src/main/asciidoc/datasource.adoc Outdated Show resolved Hide resolved
Copy link

quarkus-bot bot commented Jan 6, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit e6d6080.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

Copy link

quarkus-bot bot commented Jan 6, 2025

Status for workflow Quarkus Documentation CI

This is the status report for running Quarkus Documentation CI on commit e6d6080.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docstyle issues related for manual docstyle review area/documentation area/jdbc Issues related to the JDBC extensions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected commit of transaction using Oracle
2 participants