[
https://issues.apache.org/jira/browse/OPENJPA-2963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18111195#comment-18111195
]
ASF subversion and git services commented on OPENJPA-2963:
----------------------------------------------------------
Commit 6d1cdc17a9897252f0a51414fb1fc455bc222825 in openjpa's branch
refs/heads/OPENJPA-2963 from Richard Zowalla
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=6d1cdc17a ]
[OPENJPA-2963] Key the dropped table tracking on the configuration id
Review feedback. The connection factory name is not a reliable identity for
a database, as the review points out. The tracking is now keyed on the
configuration id, which for a persistence unit is its name, since
PersistenceUnitInfoImpl defaults openjpa.Id to it. Two factories for one
unit therefore still share their tracking, which is what lets a factory see
what a closed generateSchema() factory dropped, while two units cannot
clear or consume one another's entries. A configuration with no id falls
back to the connection it names.
The producer and the consumer move into two package visible methods, which
also gives the behaviour a seam to test through without a database.
TestSchemaToolDroppedTables covers the partitioning, the sharing within one
unit, the scoped clear and the consumption; the two partitioning cases fail
if the map is collapsed back to a single set.
> Static _droppedTables shared across concurrent EMFs
> ---------------------------------------------------
>
> Key: OPENJPA-2963
> URL: https://issues.apache.org/jira/browse/OPENJPA-2963
> Project: OpenJPA
> Issue Type: Sub-task
> Reporter: Maxim Solodovnik
> Priority: Major
>
> Discussion thread:
> https://github.com/apache/openjpa/pull/144#discussion_r3683002126
> **(medium)** `_droppedTables` is JVM-global static mutable state and
> `clearDroppedTables()` is invoked from JDBCBrokerFactory whenever any EMF
> with schema-gen properties spins up - with two persistence units initializing
> concurrently (common in app servers) one EMF wipes the other's in-flight
> tracking. Matching also uses `toUpperCase()` without `Locale.ROOT` (here,
> line 1239 and 1519-1529) and compares a full identifier against a name
> regex-stripped from raw DDL, so schema-qualified or quoted names will not
> match. Could this state live on the configuration instead?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)