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

Actually forbid simultaneous use of persistence.xml and quarkus.hibernate-orm.* properties #30409

Conversation

yrodiere
Copy link
Member

Fixes #16589

This sort of breaks backwards compatibility: we used to document that using persistence.xml alongside quarkus.hibernate-orm.* properties was forbidden and would fail, but in practice we were more lenient and such situation just resulted in quarkus.hibernate-orm.* properties being ignored. Now, we will properly fail.

I also added an INFO log when using persistence.xml, because we cannot always detect that users mean to use Quarkus-configured PUs (since we tend to allow zero-config), so in some cases we might still just ignore Quarkus-configured PUs in favor of persistence.xml...

@quarkus-bot quarkus-bot bot added area/hibernate-orm Hibernate ORM area/persistence OBSOLETE, DO NOT USE labels Jan 17, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Jan 17, 2023

/cc @Sanne (hibernate-orm), @gsmet (hibernate-orm)

@yrodiere yrodiere force-pushed the i16589-no-mixing-persistence-xml-and-quarkus-config branch from 7f36e65 to 71c9ec5 Compare January 17, 2023 11:36
@quarkus-bot

This comment has been minimized.

…us config with a persistence.xml in the classpath

Some code dealing with implied PUs was preventing that failure from even
happening...

Also note we cannot catch *every* situation where we should fail, but we can try our best.
@yrodiere yrodiere force-pushed the i16589-no-mixing-persistence-xml-and-quarkus-config branch from 71c9ec5 to 9749258 Compare January 17, 2023 15:44
@quarkus-bot
Copy link

quarkus-bot bot commented Jan 17, 2023

✔️ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

@gsmet gsmet merged commit 085612b into quarkusio:main Jan 18, 2023
@quarkus-bot quarkus-bot bot added this to the 2.17 - main milestone Jan 18, 2023
@gsmet
Copy link
Member

gsmet commented Jan 18, 2023

Please add something to the migration guide. Thanks.

@Sanne
Copy link
Member

Sanne commented Jan 18, 2023

Nice catch, thanks. FYI I do vaguely recall that we used to fail if both were present, but that seems to have gone lost.

@yrodiere
Copy link
Member Author

Please add something to the migration guide. Thanks.

Done.

FYI I do vaguely recall that we used to fail if both were present, but that seems to have gone lost.

Yes this code probably used to work, but the corresponding test was not testing the right thing, so when it stopped working that went under the radar.

@yrodiere yrodiere deleted the i16589-no-mixing-persistence-xml-and-quarkus-config branch August 7, 2023 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simultaneous use of persistence.xml and quarkus.hibernate-orm.* properties is not actually forbidden
4 participants