[OPENJPA-2959] Do not drop tables of types excluded from schema synchronization - #160
Open
rzo1 wants to merge 1 commit into
Open
[OPENJPA-2959] Do not drop tables of types excluded from schema synchronization#160rzo1 wants to merge 1 commit into
rzo1 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes
JDBCBrokerFactory.dropExcludedTypeTablesas suggested in https://issues.apache.org/jira/browse/OPENJPA-2959. The review was right on both counts: it built raw"DROP TABLE " + nameSQL withouttoDBName/quoting or CASCADE handling, and it swallowed every failure at trace level — but the real problem is that dropping a user table because its type was excluded from synchronization is destructive, and an excluded type may well be a table managed outside OpenJPA on purpose.It was also test-driven rather than a feature:
git logtraces it to 682623b, whose message says it exists "so operations against non-existent entity tables fail as expected", and the only consumer ofSyncMappingsExcludeTypesanywhere in the tree istck32-openjpa-profile.xmlforentityManager2.DoesNotExist. Excluding the type from schema creation — the part that is kept — is the actual feature; the drop only papered over a table left behind by an earlier run against a reused database.Six imports become unused and were removed with it. No test in the tree exercises
ExcludeTypes, and thepersistence.schema.**/persistence.jdbc.schema.**selection returns exactly the same 5 failures / 28 errors on this branch as on master (all pre-existing, unrelated harness issues).