Skip to content

Align the session to the latest changes in ORM 7 #2206

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

Merged
merged 4 commits into from
Apr 25, 2025

Conversation

DavideD
Copy link
Member

@DavideD DavideD commented Apr 16, 2025

Fix #2181

Mainly a first draft that I think it's reasonable to release for now.
But, the ReactiveSessionImpl needs more work. I will continue to look into it,
but I don't want to delay the Hibernate ORM release.

Merge after #2221

@DavideD DavideD force-pushed the 2181-Stateless-session branch 2 times, most recently from 6524818 to 0908464 Compare April 16, 2025 09:29
@DavideD DavideD marked this pull request as ready for review April 16, 2025 09:29
@DavideD DavideD force-pushed the 2181-Stateless-session branch 2 times, most recently from 24e6d2e to 45397c4 Compare April 16, 2025 09:34
@DavideD
Copy link
Member Author

DavideD commented Apr 16, 2025

@gavinking maybe you can have a look?

@gavinking
Copy link
Member

@gavinking maybe you can have a look?

A bit too much there to review all of it line by line, but the fragments I reviewed all look perfect to me.

@gavinking
Copy link
Member

But we had better add some tests for persistence of collections via the StatelessSession, and perhaps also a couple of basic tests for use of the second-level cache.

@DavideD
Copy link
Member Author

DavideD commented Apr 16, 2025

A bit too much there to review all of it line by line, but the fragments I reviewed all look perfect to me.

Thanks, that's what I needed

@DavideD DavideD force-pushed the 2181-Stateless-session branch 2 times, most recently from c48c7b0 to b3f1a7f Compare April 25, 2025 15:17
@DavideD DavideD changed the base branch from wip/3.0 to main April 25, 2025 15:17
DavideD added 4 commits April 25, 2025 17:23
It's useful for when we need to map a try-finally block.
I'm going to add this because ORM log this message when
a JDBCException happens.

I don't expect it to happen in Hibernate Reactive, but
I don't have time now to check for sure.
@DavideD DavideD force-pushed the 2181-Stateless-session branch from b3f1a7f to e54a21f Compare April 25, 2025 15:23
/**
* @see SessionImpl#load(LoadEventListener.LoadType, Object, String, LockOptions, Boolean)
*/
public CompletionStage<Object> reactiveLoad(LoadEventListener.LoadType loadType, Object id, String entityName, LockOptions lockOptions, Boolean readOnly) {

Check notice

Code scanning / CodeQL

Missing Override annotation Note

This method overrides
ReactiveSession.reactiveLoad
; it is advisable to add an Override annotation.
@@ -224,12 +223,12 @@

return getEntityPersister( entityClass.getName() )
.reactiveMultiLoad( sids, this, StatelessSessionImpl.MULTI_ID_LOAD_OPTIONS )
.whenComplete( (v, e) -> {
.whenComplete( (list, e) -> {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'list' is never used.
@@ -224,12 +223,12 @@

return getEntityPersister( entityClass.getName() )
.reactiveMultiLoad( sids, this, StatelessSessionImpl.MULTI_ID_LOAD_OPTIONS )
.whenComplete( (v, e) -> {
.whenComplete( (list, e) -> {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'e' is never used.
@DavideD
Copy link
Member Author

DavideD commented Apr 25, 2025

I'm going to merge it and create an issue to remember to add the missing tests for the StatelessSession

@DavideD DavideD merged commit d5b75b5 into hibernate:main Apr 25, 2025
18 checks passed
@gavinking
Copy link
Member

I'm going to merge it and create an issue to remember to add the missing tests for the StatelessSession

Perfect. Note that there are new tests in ORM that you can easily copy/paste.

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

Successfully merging this pull request may close these issues.

StatelessSession, collections, and second-level cache
2 participants