Skip to content
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

Add support for STATEMENT_INSPECTOR in Hibernate ORM #27403

Closed
llongeri opened this issue Aug 21, 2022 · 4 comments · Fixed by #30640
Closed

Add support for STATEMENT_INSPECTOR in Hibernate ORM #27403

llongeri opened this issue Aug 21, 2022 · 4 comments · Fixed by #30640
Labels
area/hibernate-orm Hibernate ORM area/persistence OBSOLETE, DO NOT USE kind/enhancement New feature or request
Milestone

Comments

@llongeri
Copy link

Description

Add support to configure a org.hibernate.resource.jdbc.spi.StatementInspector
which is defined in org.hibernate.cfg.AvailableSettings.STATEMENT_INSPECTOR

So that it could be added in application.properties as:
quarkus.hibernate-orm.session_factory.statement_inspector=org.example.MyStatementInspector
or
quarkus.hibernate-orm.other.session_factory.statement_inspector=org.example.MyStatementInspector

The stament inspector instantiated should be a managed bean.

Implementation ideas

No response

@llongeri llongeri added the kind/enhancement New feature or request label Aug 21, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Aug 21, 2022

/cc @Sanne, @gsmet, @yrodiere

@quarkus-bot quarkus-bot bot added area/hibernate-orm Hibernate ORM area/persistence OBSOLETE, DO NOT USE labels Aug 21, 2022
@Sanne
Copy link
Member

Sanne commented Aug 22, 2022

Thanks for raising this!

I'm in favour of adding such a feature, but I wonder if we could omit the configuration property: especially as it's a managed bean, we could wire it to Hibernate during bootstrap using @PersistenceUnitExtension

Similarly to how we do Interceptors:

What would you think of it? I haven't tried it though, it would need a POC first to see if I'm missing something.

@llongeri
Copy link
Author

using @PersistenceUnitExtension is a much better solution.
I will try to make a POC.

@yrodiere
Copy link
Member

For anyone ending up here and not wanting to contribute the feature, there is a workaround that I just used in integration tests (#30392): rely on quarkus.hibernate-orm.unsupported-properties, e.g.:

quarkus.hibernate-orm.unsupported-properties."hibernate.session_factory.statement_inspector" = com.acme.MyInspector

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hibernate-orm Hibernate ORM area/persistence OBSOLETE, DO NOT USE kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants