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

Liquibase diffChangeLog generation is broken in 1.7.1 #11692

Closed
AlexKovynev opened this issue Aug 28, 2020 · 9 comments · Fixed by #11738
Closed

Liquibase diffChangeLog generation is broken in 1.7.1 #11692

AlexKovynev opened this issue Aug 28, 2020 · 9 comments · Fixed by #11738
Labels
area/liquibase kind/bug Something isn't working
Milestone

Comments

@AlexKovynev
Copy link

Describe the bug
I use hibernate-liquibase as a plugin for maven or as a plugin in command-line. In both variants fail in 1.7 but work in 1.6.1.

Unexpected error running Liquibase: Duplicate event listener found
liquibase.exception.DatabaseException: org.hibernate.event.service.spi.EventListenerRegistrationException: Duplicate event listener found.

It's like some events now is auto registered.

Expected behavior
Generate something.

Actual behavior
Exception.

To Reproduce
Steps to reproduce the behavior:

  1. Liquibase diffChangeLog

Environment (please complete the following information):

  • Output of java -version: openjdk version "11.0.7" 2020-04-14
  • Quarkus version or git rev: 1.7.1
  • Build tool (ie. output of mvnw --version or gradlew --version): 3.6.3
@AlexKovynev AlexKovynev added the kind/bug Something isn't working label Aug 28, 2020
@geoand
Copy link
Contributor

geoand commented Aug 28, 2020

Can you please provide a minimal reproducer?

Thanks

@gsmet
Copy link
Member

gsmet commented Aug 28, 2020

I think the issue is similar to #11679 (on Zulip, the OP had the same exception IIRC)

@gsmet
Copy link
Member

gsmet commented Aug 28, 2020

And we have a reproducer there but another one might be helpful.

@AlexKovynev
Copy link
Author

AlexKovynev commented Aug 28, 2020

@geoand It is a problem with a quarkus-hibernate-validator. If i downgrade version to 1.6.1.Final then command work.

Small reproducer with one model and h2 in-memory datasource.

./mvnw clean install liquibase:diff

reproducer.zip

@gsmet And it's breakage of 1.7.1 version only, quarkus-hibernate-validator 1.7.0 works too.

@AlexKovynev AlexKovynev changed the title Liquibase diffChangeLog generation is broken in 1.7 Liquibase diffChangeLog generation is broken in 1.7.1 Aug 28, 2020
@kunieda-o
Copy link

I also found the error like this. 1.7.0 works well but 1.7.1 doesn't work well.

Map<String, Object> properties = new HashMap<>();
properties.put(AvailableSettings.DRIVER, "org.h2.Driver");
properties.put(AvailableSettings.URL, "jdbc:h2:mem:test");
PersistenceUnitInfoAdapter unitInfo = new PersistenceUnitInfoAdapter("test");
EntityManagerFactory emf = new HibernatePersistenceProvider().createContainerEntityManagerFactory(unitInfo, properties);

I use above in Unit test.

@geoand
Copy link
Contributor

geoand commented Aug 30, 2020

Thanks for reporting. I'll have a look soon

@gsmet gsmet added this to the 1.7.2.Final milestone Aug 30, 2020
@geoand geoand self-assigned this Aug 31, 2020
@geoand
Copy link
Contributor

geoand commented Aug 31, 2020

It turns out that different behavior between 1.7.0.Final and 1.7.1.Final is caused by commit e68c5f6 of #/11494.

Basically what happens is that because that commit added the org.hibernate.integrator.spi.Integrator file to the HV extension, now HV seems to be loaded twice when Hibernate is booted manually (which is the case for the Liquibase plugin and the test snippet mentioned above).

This use case is not something we ever supported and the fact that it used to work is pure coincidence IMHO.

Since I am no Hibernate expert, I'll hand this one over to @gsmet and @Sanne

@gsmet
Copy link
Member

gsmet commented Aug 31, 2020

It's going to be fixed in 1.7.2 but keep in mind that we don't support creating EMF manually. You lose most of Hibernate ORM Quarkus optimizations by creating the EMF manually. And there's a good chance it won't work at all or work differently (except if you carefully apply all the settings applied by Quarkus).

@AlexKovynev
Copy link
Author

AlexKovynev commented Aug 31, 2020

Ok, thank you, unfortunately liquibase-hibernate does not support quarkus, only spring and pu from dedicated xml. And as i know we do not have any analogs in the market now for generate migrations automaticaly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/liquibase kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants