-
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
Remove support for hibernate.properties (long deprecated) #17538
Conversation
...rm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/recording/RecordableBootstrap.java
Outdated
Show resolved
Hide resolved
@Sanne could you have a look at George's comment? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll copy my comment from the issue:
but it appears from report #17515 that this was no longer working at all.
The question is how long has this not been working. At least on April 13th, it was still working, since there's a reproducer here that uses
hibernate.properties
as a workaround: #16463
After some investigation, my use of hibernate.properties
in #16463 apparently didn't work. I don't know why I thought it did.
Anyway... It led me to investigate a bit more. I believe hibernate.properties
does work in very few cases. Hibernate ORM discovers the hibernate.properties
by itself, at runtime, in org.hibernate.cfg.Environment
, and these properties are used in a few places.
In particular:
- In
org.hibernate.dialect.MySQLDialect#MySQLDialect
to determine the storage engine. - In a few global settings that are deprecated, but still used:
org.hibernate.cfg.Environment#ENABLE_BINARY_STREAMS
- Controls the value of
org.hibernate.internal.FastSessionServices#useStreamForLobBinding
- Controls the value of
org.hibernate.cfg.Environment#ENABLE_REFLECTION_OPTIMIZER
- Controls the use of reflection optimizers in
org.hibernate.tuple.entity.PojoEntityTuplizer
andorg.hibernate.tuple.component.PojoComponentTuplizer
.
- Controls the use of reflection optimizers in
org.hibernate.cfg.Environment#ENABLE_LEGACY_PROXY_CLASSNAMES
- Controls the value of
org.hibernate.bytecode.internal.bytebuddy.BasicProxyFactoryImpl#PROXY_NAMING_SUFFIX
andorg.hibernate.proxy.pojo.bytebuddy.ByteBuddyProxyHelper#PROXY_NAMING_SUFFIX
- Controls the value of
- In
org.hibernate.cfg.Environment#BYTECODE_PROVIDER_INSTANCE
, which is used:- When deserializing proxies:
org.hibernate.proxy.pojo.bytebuddy.SerializableProxy#readResolve
- In Ant/Maven/Gradle plugins:
org.hibernate.tool.enhance.EnhancementTask#execute
/org.hibernate.orm.tooling.maven.MavenEnhancePlugin#execute
/org.hibernate.orm.tooling.gradle.EnhancementHelper#enhance
- When deserializing proxies:
- Some other places that are not relevant to Quarkus, as far as I can see.
So I don't know how I should feel about this patch. Yes it removes dead code, but it doesn't completely remove support for hibernate.properties
, which will still work... sometimes.
If we really want to close this topic for good, I'd suggest maybe adding some code to log a warning on startup if there is a hibernate.properties
, and remove the file entirely? That way, we're sure there won't be any confusion as to whether it works or not.
...rm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/recording/RecordableBootstrap.java
Outdated
Show resolved
Hide resolved
13930ae
to
2a8d56d
Compare
updated the commit |
hi @yrodiere , thanks for the analysis! And sorry I've only seen your comment after pushing the rebased version.
Regarding having the warning, you mean like the warning we had in Regarding "and remove the file entirely?" , WDYM - to remove the |
I mean that a user including a
I meant not adding it to the JAR. I agree we shouldn't alter source files. |
I don't think we have the ability to override what the build tool will do? Regarding the warning, yes good idea. So you mean similar to the warning we had until now, but processed by the deployment component, right? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Too bad. I thought, since we can add class files, why not remove resource files... But ok. The warning should address the problem for the vast majority of users.
Yes. |
2a8d56d
to
6f44b40
Compare
@yrodiere adapted and rebased. I went a step further and decided to throw an exception rather than logging a warning - I know it's rather aggressive, but I prefer motivating feedback on this with more urgency than what I'd get with a warning. |
I'm not sure that's wise, as there are some people out there who pull legacy JARs, which contain a Anyway, +1 to merge as long as everyone is okay with breaking existing applications that contain a |
Right, that's why I have the error message print the location. Regarding this being problematic for legacy applications, I agree with your concern but still think we need to hear about those and you also pointed out yourself how problematic that can be - and Quarkus has always made it clear it's not meant for legacy. |
#Fixes #17537