Skip to content

[OPENJPA-2959] Do not drop tables of types excluded from schema synchronization - #160

Open
rzo1 wants to merge 1 commit into
masterfrom
OPENJPA-2959
Open

[OPENJPA-2959] Do not drop tables of types excluded from schema synchronization#160
rzo1 wants to merge 1 commit into
masterfrom
OPENJPA-2959

Conversation

@rzo1

@rzo1 rzo1 commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Removes JDBCBrokerFactory.dropExcludedTypeTables as suggested in https://issues.apache.org/jira/browse/OPENJPA-2959. The review was right on both counts: it built raw "DROP TABLE " + name SQL without toDBName/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 log traces it to 682623b, whose message says it exists "so operations against non-existent entity tables fail as expected", and the only consumer of SyncMappingsExcludeTypes anywhere in the tree is tck32-openjpa-profile.xml for entityManager2.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 the persistence.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).

@rzo1 rzo1 self-assigned this Aug 21, 2026
@rzo1
rzo1 requested a review from solomax August 21, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant