-
Consider the following snippet: class MyController(
private val sessionFactory: SessionFactory
) {
@Transactional
fun entrypoint(): Response {
val session = sessionFactory.currentSession
session.isDefaultReadOnly = true
val whatever = session.use { session ->
// ...
}
// ...
} I keep seeing Using a new session via
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
/cc @geoand (kotlin), @gsmet (hibernate-orm), @yrodiere (hibernate-orm) |
Beta Was this translation helpful? Give feedback.
-
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
It is since that feature isn't implemented.
Yes.
Quarkus proxies sessions and creates one per transaction behind the scenes, which is the recommended way of doing things. So, injecting is the way to go. |
Beta Was this translation helpful? Give feedback.
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
It is since that feature isn't implemented.
Yes.