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

hibernate.* properties in Hibernate-ORM extension #12724

Closed
neon-dev opened this issue Oct 14, 2020 · 7 comments · Fixed by #26128
Closed

hibernate.* properties in Hibernate-ORM extension #12724

neon-dev opened this issue Oct 14, 2020 · 7 comments · Fixed by #26128
Labels

Comments

@neon-dev
Copy link
Contributor

Description
I am missing a way to configure hibernate.event.merge.entity_copy_observer (see) from application.properties.
Using a persistence.xml I can set all kinds of properties but as I read, in terms of Quarkus it's "the old way" of doing things and not encouraged.

Implementation ideas
If I understand correctly, quarkus.hibernate-orm.* properties are global. So where I could set hibernate.show_sql per persistence unit before, I can now only set quarkus.hibernate-orm.log.sql for all datasources using Hibernate? It might be useful to set these properties per datasource. Also I think it'd be better to implement such properties in a pass-through way, so it's no question anymore whether Hibernate property X can be specified via application.properties.

@neon-dev neon-dev added the kind/enhancement New feature or request label Oct 14, 2020
@quarkusbot
Copy link

/cc @gsmet, @Sanne

@famod
Copy link
Member

famod commented Oct 14, 2020

I have a similar problem: I need to register a custom StatementInspector.
See also: https://quarkusio.zulipchat.com/#narrow/stream/187030-users/topic/Hibernate.20StatementInspector

@Sanne
Copy link
Member

Sanne commented Oct 21, 2020

+1 to have way to observe merge events.

But as @famod linked to, I believe that we shouldnt' expose the configurfation properties but rather expose a simple way to register listeners and customized components linked to the persistence unit.

I definitely don't want to "forward" all hibernate.* properties; we're restricting them for various good reasons.

@neon-dev
Copy link
Contributor Author

we're restricting them for various good reasons

Could you please elaborate? It works with a persistence.xml, so why artificially limit configuration properties for datasources defined purely in application.properties?
Also, is there currently a way to set hibernate.event.merge.entity_copy_observer=allow without a dedicated persistence.xml?

@frederikb
Copy link

May I respectfully suggest considering the addition of the hibernate.use_sql_comments option to complete the SQL logging trifecta? It is a helpful debugging tool.

Explanation/Example: https://dzone.com/articles/hibernate-debugging-where-does
Reference: https://docs.jboss.org/hibernate/orm/5.4/userguide/html_single/Hibernate_User_Guide.html#_sql_statement_logging

@goafabric
Copy link

I also have the Requirement to register a StatementInspector.
Is there any progress for this issue ?

@yrodiere
Copy link
Member

Duplicates #19129

This was fixed in Quarkus 2.11.0.CR1, see #26128

@yrodiere yrodiere linked a pull request Jul 20, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants