Raymond Domingo created DELTASPIKE-1378:
-------------------------------------------
Summary: 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, 1.8.0
Reporter: Raymond Domingo
*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)