[ 
https://issues.apache.org/jira/browse/OPENJPA-2982?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18119524#comment-18119524
 ] 

ASF subversion and git services commented on OPENJPA-2982:
----------------------------------------------------------

Commit 90fc29945b13b30703c206920a268dd9bd4a3ddb in openjpa's branch 
refs/heads/OPENJPA-2982 from Richard Zowalla
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=90fc29945 ]

[OPENJPA-2982] Do not cache the factory properties before the EM defaults are 
known

getProperties() caches its result, so a call made before the first
EntityManager was created permanently lacked the EM level defaults.
Only install the cache once emEmptyPropsProperties is set, so a caller
racing with the first createEntityManager() can no longer make an
incomplete map stick, and make both fields volatile for visibility.


> 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