public class JpaPersistenceContextManager extends AbstractPersistenceContextManager implements org.drools.persistence.api.PersistenceContextManager
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: KieSessionKieSession by multiple threads. In other words, when multiple threads call operations on a Singleton persistent
KieSession.ThreadLocal instances for two things:EntityManager instance.appScopedEntityManager, cmdScopedEntityManager, emf, env, internalAppScopedEntityManagerFlag, internalCmdScopedEntityManagerFlag, txm| Constructor and Description |
|---|
JpaPersistenceContextManager(org.kie.api.runtime.Environment env) |
| Modifier and Type | Method and Description |
|---|---|
void |
beginCommandScopedEntityManager() |
org.drools.persistence.api.PersistenceContext |
getApplicationScopedPersistenceContext() |
org.drools.persistence.api.PersistenceContext |
getCommandScopedPersistenceContext() |
dispose, endCommandScopedEntityManager, getApplicationScopedEntityManager, getCommandScopedEntityManager, getInternalCommandScopedEntityManager, resetApplicationScopedPersistenceContextpublic JpaPersistenceContextManager(org.kie.api.runtime.Environment env)
public org.drools.persistence.api.PersistenceContext getApplicationScopedPersistenceContext()
getApplicationScopedPersistenceContext in interface org.drools.persistence.api.PersistenceContextManagerpublic org.drools.persistence.api.PersistenceContext getCommandScopedPersistenceContext()
getCommandScopedPersistenceContext in interface org.drools.persistence.api.PersistenceContextManagerpublic void beginCommandScopedEntityManager()
beginCommandScopedEntityManager in interface org.drools.persistence.api.PersistenceContextManagerCopyright © 2001–2021 JBoss by Red Hat. All rights reserved.