Description
Provide sane, safe, well-performing defaults for persistence context / Hibernate Session access patterns, while offering flexibility (features) for more advanced use case. This involves in particular work on transaction/session scopes and possibly corresponding connection handling within Hibernate.
Analysis
I'm creating this to track multiple feature requests / bugs on a common theme, in an attempt to tackle them with a consistent strategy.
Don't get me wrong, we're mostly there in many cases, but there are still some use cases for which the current state of affairs is unsatisfying, and I think we should try to tackle them as well.
One area of improvement @lucamolteni is already working on is aligning session access patterns in Hibernate Reactive on what we do for "classic" Hibernate ORM.
But beyond that, even in Hibernate ORM we've identifyied use cases we don't quite address as well as we'd like:
- read-only scenarios (reducing resource usage for e.g. entity state tracking, switching to read-only DB replicas)
- long-running scenarios (limiting time spent holding connections)
- multi-transaction scenarios, possibly with (read-only?) session access in-between transaction
- ...
Description
Provide sane, safe, well-performing defaults for persistence context / Hibernate Session access patterns, while offering flexibility (features) for more advanced use case. This involves in particular work on transaction/session scopes and possibly corresponding connection handling within Hibernate.
Analysis
I'm creating this to track multiple feature requests / bugs on a common theme, in an attempt to tackle them with a consistent strategy.
Don't get me wrong, we're mostly there in many cases, but there are still some use cases for which the current state of affairs is unsatisfying, and I think we should try to tackle them as well.
One area of improvement @lucamolteni is already working on is aligning session access patterns in Hibernate Reactive on what we do for "classic" Hibernate ORM.
But beyond that, even in Hibernate ORM we've identifyied use cases we don't quite address as well as we'd like: