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

GenerateSchema mode leaves autoCreate/validate turned on #363

Closed
andyjefferson opened this issue Jan 20, 2021 · 2 comments
Closed

GenerateSchema mode leaves autoCreate/validate turned on #363

andyjefferson opened this issue Jan 20, 2021 · 2 comments
Labels
Milestone

Comments

@andyjefferson
Copy link
Member

andyjefferson commented Jan 20, 2021

When we start up a PMF/EMF with create/drop scripts for creating the database schema we currently turn the auto-create/validate flags to true, presumably to allow any scripts to be invoked. See https://github.com/datanucleus/datanucleus-core/blob/master/src/main/java/org/datanucleus/PersistenceNucleusContextImpl.java#L415

This means that those settings are ON thereafter, so any FKs that we did not create during schema generation from script will be generated automatically. Which we don't want.

Do we really even need these properties enabling in the first place just to invoke script commands?

@andyjefferson andyjefferson added this to the 5.2.6 milestone Jan 20, 2021
@andyjefferson
Copy link
Member Author

Turns out those properties are only needed to be added when GENERATING SCRIPTS, and not when executing scripts to create the database

@andyjefferson
Copy link
Member Author

Actually jpa/jta tests show a problem if we do this, so reverted the change. Find a better way to fix the issue

@andyjefferson andyjefferson reopened this Apr 16, 2021
@andyjefferson andyjefferson removed this from the 5.2.6 milestone Apr 16, 2021
@andyjefferson andyjefferson added this to the 6.0.0.m1 milestone Apr 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant