-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
The FastBootEntityManagerFactoryBuilder doesn't allow us to decorate the SessionFactory #33564
Comments
Hi @vladmihalcea , we don't necessarily support all SPI and integrations; we can consider this but I'm classifying it as a feature request. Could you elaborate on why you need to decorate it? |
@Sanne Thanks for the explanation. This is needed by the Quarkus clients who are also using Hypersistence Optimizer to detect performance issues automatically. This problem has been reported by one of the users in this issue. |
Ic, thanks. But could you explain which aspect of the We can't expose the SessionFactoryBuilder as-is as it allows several options which Quarkus sets/controls automatically, and really are a bit specific to runtime integrations so not really interesting to end users, but we can look into exposing particular observability hooks. For example, if you need |
Hypersistence Optimizer uses the For this, it relies on the |
Hello @Sanne @vladmihalcea |
@adampoplawski It's unfortunate that Quarkus took the decision to not honor that SPI contract. Hypersistence Optimizer can decorate Spring Boot just fine, and starting with version 2.8, it will support Micronout as well. Therefore, until this issue is fixed, if you want to benefit from all the advantages offered by Hypersistence Optimizer, you can use Spring Boot or Micronout instead for your services. |
@Sanne Any update on that request ? |
@Sanne Is this still considered? Maybe an option would be to allow this only to the dev/test profile? |
Hello @Sanne |
Hello, If by "accepted" you mean "someone from the Quarkus team will work on it", then I'm afraid it's unlikely as there are more pressing issues. Sanne himself is busy elsewhere these days. If by "accepted" you mean "someone will have a look at a PR and merge it if it seems safe", then that's more likely. It does seem possible to shoehorn something in here: Lines 82 to 91 in 47ecd0a
That would look more like Hibernate ORM at https://github.com/hibernate/hibernate-orm/blob/f0f96916adb5adbba56ed19f583343559d16576b/hibernate-core/src/main/java/org/hibernate/jpa/boot/internal/EntityManagerFactoryBuilderImpl.java#L1455 However, I'm pretty sure at least some (most?) of the So, it'll be work. It'll require testing. It'll require documenting limitations. But if someone feels strongly about it, they can give it a try. |
Describe the bug
Hibernate Core provides the
EntityManagerFactoryBuilderImpl
so that when building anEntityManagerFactory
, theSessionFactoryBuilder
SPI is used, like this:Quarkus does not do that. Instead, it creates a hardcoded
SessionFactoryImpl
in theFastBootEntityManagerFactoryBuilder
, like this:Expected behavior
The
FastBootEntityManagerFactoryBuilder
should use theSessionFactoryBuilder
so that applications can decorate the HibernateSessionFactory
via this SPI mechanism.Actual behavior
The
SessionFactoryImpl
is instantiated no matter if we declare aorg.hibernate.boot.spi.SessionFactoryBuilderFactory
SPI.How to Reproduce?
No response
Output of
uname -a
orver
No response
Output of
java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
No response
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: