Skip to content

Hibernate Interceptor Session #43166

Answered by yrodiere
fabrii asked this question in Q&A
Sep 9, 2024 · 4 comments · 1 reply
Discussion options

You must be logged in to vote

I don't think Intereceptor is the right tool for the job, as it's primarily focused on entities, and you're focusing on the JDBC connection.

If you're using this to record entities as "owned" by a particular client, and filter entities down to those belonging to a particular client, I'd recommend using the built-in discriminator-based multitenancy feature instead. See https://quarkus.io/guides/hibernate-orm#discriminator-approach , https://docs.jboss.org/hibernate/orm/6.6/userguide/html_single/Hibernate_User_Guide.html#multitenacy-hibernate-TenantId

If your use case is different, and you really just need to execute some dynamic SQL every time a connection is retrieved, then I think you ne…

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@fabrii
Comment options

Answer selected by fabrii
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
kind/enhancement New feature or request area/hibernate-orm Hibernate ORM
2 participants
Converted from issue

This discussion was converted from issue #43154 on September 10, 2024 06:59.