Skip to content
Discussion options

You must be logged in to vote

Shouldn't sessionFactory.currentSession return the session associated with the current @transactional transaction? I thought it would after reading this: https://docs.jboss.org/hibernate/orm/current/userguide/html_single/Hibernate_User_Guide.html#session-per-request

It could, but in Quarkus I don't think it will. It really depends on your integration. You can request that as a feature if you want: https://github.com/quarkusio/quarkus/issues/new/choose

Is it an error to use currentSession?

It is since that feature isn't implemented.

Is it preferred to inject a [Stateless]Session instead of SessionFactory?

Yes.

The Hibernate documentation also states that too many granular sessions a…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@okarmazin
Comment options

@yrodiere
Comment options

Answer selected by okarmazin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants