[ 
https://issues.apache.org/jira/browse/OPENJPA-2982?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Richard Zowalla resolved OPENJPA-2982.
--------------------------------------
    Resolution: Not A Problem

Intentional: I tried the suggested remedy (invalidate the cached map once 
emEmptyPropsProperties is set, so the EntityManager level defaults are always 
merged) and it breaks TestSchemaGenDrop, which feeds emf.getProperties() back 
into createEntityManagerFactory - the EntityManager level values are user 
readable and cannot be consumed as configuration (openjpa.AutoClear as an 
AutoClearType enum, live instances for openjpa.EntityManagerFactory and 
openjpa.ManagedRuntime, and unprefixed keys colliding with their openjpa.* 
counterparts). Merging only the keys the factory does not already know avoids 
the enum problem but still fails on the key collision, and it breaks 
TestPropertiesMethods.testEMFPropertyValueTypeIsPreserved, which asserts that 
openjpa.AutoClear is an AutoClearType - so the two expectations contradict each 
other and each test passes today only because of the order in which it calls 
getProperties(). The ordering dependence is therefore a symptom of the map 
serving as both a human readable report and configuration input, which is 
tracked in OPENJPA-3006; closing this as Not A Problem.

> getProperties() caches map missing EM-level defaults
> ----------------------------------------------------
>
>                 Key: OPENJPA-2982
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2982
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: jpa
>    Affects Versions: 4.2.0
>            Reporter: Maxim Solodovnik
>            Priority: Major
>             Fix For: 4.2.0
>
>
> Discussion thread: 
> https://github.com/apache/openjpa/pull/144#discussion_r3683005250
> **(low)** The old else branch seeding `getProperties()` from a throwaway EM 
> was removed, so the result now depends on whether an EM was created before 
> the first call - and since the map is cached, the EM-level defaults are then 
> permanently missing. Intentional, or should the cache be invalidated once 
> `emEmptyPropsProperties` becomes available?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to