You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by "Gerhard Petracek (JIRA)" <ji...@apache.org> on 2019/05/14 22:39:00 UTC
[jira] [Resolved] (DELTASPIKE-1378) EntityManagerRefLookup returns
null globalEntityManager when lazyInitGlobalEntityManager is called by
multiple threads
[ https://issues.apache.org/jira/browse/DELTASPIKE-1378?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gerhard Petracek resolved DELTASPIKE-1378.
------------------------------------------
Resolution: Fixed
> EntityManagerRefLookup returns null globalEntityManager when lazyInitGlobalEntityManager is called by multiple threads
> ----------------------------------------------------------------------------------------------------------------------
>
> Key: DELTASPIKE-1378
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-1378
> Project: DeltaSpike
> Issue Type: Bug
> Components: JPA-Module
> Affects Versions: 1.9.0
> Reporter: Raymond Domingo
> Assignee: Thomas Andraschko
> Priority: Major
> Fix For: 1.9.1
>
>
> *Situation*
> If multiple threads invoke lazyInitGlobalEntityManager at same time and lazyInitGlobalEntityManager isn't invoked before. Some of these threads might end up with a null entitymanager, because lazyInitGlobalEntityManager isn't synchronized (or this.globalEntityManagerInitialized = true is at wrong place).
> Might be *important* to fix this, because In rare situations this might break your application and even cause inconsistent data.
> *Problem*
> entityManager is null after initialization is concurrently called
> *Expected*
> entityManager won't be null when initialized concurrently
>
> *PR*
> [https://github.com/apache/deltaspike/pull/89]
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)