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: 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.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
public JpaPersistenceContextManager(org.kie.api.runtime.Environment env)
public org.drools.persistence.api.PersistenceContext getApplicationScopedPersistenceContext()
getApplicationScopedPersistenceContext
in interface org.drools.persistence.api.PersistenceContextManager
public org.drools.persistence.api.PersistenceContext getCommandScopedPersistenceContext()
getCommandScopedPersistenceContext
in interface org.drools.persistence.api.PersistenceContextManager
public void beginCommandScopedEntityManager()
beginCommandScopedEntityManager
in interface org.drools.persistence.api.PersistenceContextManager
Copyright © 2001–2018 JBoss by Red Hat. All rights reserved.