-
Notifications
You must be signed in to change notification settings - Fork 492
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
Flyway: disable DDL generation from EclipseLink #5871
Comments
Thanks @poikilotherm for the tag, I'll tag @landreev and @scolapasta as well. |
@poikilotherm I agree, in our version we just disabled eclipse-link ddl generation. In terms of hibernate you are going to have some troubles, since some annotation syntax changed and you gonna get LazyLoadingException on the face since for whatever reason lazy loading was disabled in this app. But changing to Hibernate will also resolve the problem that you can't use java streams on entities since there is a bug in the eclipse-link. |
Thanks @MrK191 for pointing out the monsters lurking in the shadows. 😄 |
@poikilotherm @MrK191 if there's a feature missing from the JPA spec can one of you please open an issue at https://github.com/eclipse-ee4j/jpa-api ? (I have one open issue over there. 😄 ) |
@pdurbin Nothing is missing, it's just that the glassfish 4 uses eclipse-link version that has this bug. |
@MrK191 ok, you're saying there's a bug in the version of eclipse-link in the somewhat ancient version of Glassfish we're stuck on. That's bad news but I'm glad to hear that there's nothing missing from the JPA standard and that we don't have to move to one particular JPA implementation (Hibernate) to resolve this issue. I like standards. 😄 |
@poikilotherm and I had a short chat about this issue just now: http://irclog.iq.harvard.edu/dataverse/2019-10-22#i_110035 My take away is that overall, adding Flyway to the mix has been a step forward but there are further improvements we can make so that upgrading Dataverse is easier. |
@poikilotherm fantastic! Can you please push a branch and maybe even make a pull request so we can see it? |
To focus on the most important features and bugs, we are closing issues created before 2020 (version 5.0) that are not new feature requests with the label 'Type: Feature'. If you created this issue and you feel the team should revisit this decision, please reopen the issue and leave a comment. |
This is a successor issue to #5862.
This kind of relates to #5854.
This should be read by @pdurbin, @MrK191, @donsizemore and @djbrooke at least.
Since the introduction of Flyway in #5344, only minor modifications happened to the schema.
In #5822 a new column has been added and since it had been merged, the develop branch no longer deploys on new "installations".
Some background on the cause:
EclipseLink ORM generates a DDL script from all models on startup and (due to this setting in persistance.xml) creates new tables when not existing. It does not update existing tables. This job is left to Flyway, which is one reason why it had been introduced.
Flyway throws exceptions due to a conflict, trying to change something already present. In #5822, a new column should be added, but on new deployments, EclipseLink already generated the mapping. Thus the deployment fails.
How to get along with this:
Obviously, one could just use workarounds as #5866 does. It would be better to have a discussion and decision on how to deal with database model, mappings, EclipseLink and Flyway in the future, write down a process and adapt.
IMHO there is only one "good" solution, but this is only a proposal and needs to be discussed and/or modified:
It might be an option to switch from EclipseLink JPA to Hibernate JPA as it offers easier to use validation mechanisms than EclipseLink does.
The text was updated successfully, but these errors were encountered: