public abstract class AbstractPersistenceContextManager extends Object
JpaPersistenceContext
objects, and the underlying persistence context (EntityManager
)
instances for a persistent KieSession
and other infrastructure classes that use persistence in KIE projects.
(For reference in the following documentation: the EntityManager
is the class used to represent a persistence context)
There are 2 issues to take into account when looking at or modifying the code here: KieSession
KieSession
by multiple threads. In other words, when multiple threads call operations on a Singleton persistent
KieSession
.ThreadLocal
instances for two things:EntityManager
instance.Modifier and Type | Field and Description |
---|---|
protected javax.persistence.EntityManager |
appScopedEntityManager |
protected javax.persistence.EntityManager |
cmdScopedEntityManager |
protected javax.persistence.EntityManagerFactory |
emf |
protected org.kie.api.runtime.Environment |
env |
protected boolean |
internalAppScopedEntityManagerFlag |
protected boolean |
internalCmdScopedEntityManagerFlag |
protected org.drools.persistence.api.TransactionManager |
txm |
Constructor and Description |
---|
AbstractPersistenceContextManager(org.kie.api.runtime.Environment env) |
Modifier and Type | Method and Description |
---|---|
void |
dispose() |
void |
endCommandScopedEntityManager() |
javax.persistence.EntityManager |
getApplicationScopedEntityManager() |
javax.persistence.EntityManager |
getCommandScopedEntityManager() |
protected javax.persistence.EntityManager |
getInternalCommandScopedEntityManager() |
protected final org.kie.api.runtime.Environment env
protected final javax.persistence.EntityManagerFactory emf
protected final org.drools.persistence.api.TransactionManager txm
protected volatile javax.persistence.EntityManager appScopedEntityManager
protected volatile javax.persistence.EntityManager cmdScopedEntityManager
protected volatile boolean internalAppScopedEntityManagerFlag
protected volatile boolean internalCmdScopedEntityManagerFlag
public AbstractPersistenceContextManager(org.kie.api.runtime.Environment env)
public javax.persistence.EntityManager getApplicationScopedEntityManager()
public javax.persistence.EntityManager getCommandScopedEntityManager()
public void endCommandScopedEntityManager()
public void dispose()
protected javax.persistence.EntityManager getInternalCommandScopedEntityManager()
Copyright © 2001–2018 JBoss by Red Hat. All rights reserved.