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

HHH-18867 correctly implement the documented semantics of beginTransaction() #9287

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

Conversation

gavinking
Copy link
Member

and clarify its semantics in the jdoc

[Please describe here what your change is about]


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


@hibernate-github-bot
Copy link

hibernate-github-bot bot commented Nov 20, 2024

Thanks for your pull request!

This pull request does not follow the contribution rules. Could you have a look?

❌ All commit messages should start with a JIRA issue key matching pattern HHH-\d+
    ↳ Offending commits: [5cc6eed, eec7b8a]

› This message was automatically generated.

…PA method

The JPA spec does not have anything to say about our beginTransaction() method
@gavinking gavinking changed the title correctly implement the documented semantics of beginTransaction() HHH-18867 correctly implement the documented semantics of beginTransaction() Nov 20, 2024
@gavinking
Copy link
Member Author

@sebersole WDYT?

@sebersole
Copy link
Member

I dislike changing the semantics here yet again. We've changed the semantics around Transaction a few times the last couple of releases.

But I agree this does match better with the JPA spec, so +1

@@ -68,6 +68,17 @@ public interface SharedSessionContract extends QueryProducer, AutoCloseable, Ser
* Begin a unit of work and return the associated {@link Transaction} object.
* If a new underlying transaction is required, begin the transaction. Otherwise,
* continue the new work in the context of the existing underlying transaction.
* <p>
* The JPA-standard way to begin a new transaction is by calling
Copy link
Member

Choose a reason for hiding this comment

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

Since you are calling out JPA-specific expectations here, might also be worth noting here that JPA disallows this in JTA environments and we also honor that with strict compliance.

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.

3 participants