|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.myfaces.extensions.cdi.jpa.impl.LegacyTransactionalInterceptorStrategy
@Dependent @Alternative public class LegacyTransactionalInterceptorStrategy
Attention! although this impl is called 'Default...' it is not used anymore! If you still like to use it, then enable it as Alternative in your bean.xml!
Old implementation of our pluggable PersistenceStrategy. It supports nested Transactions with the MANDATORY behaviour.
The outermost @Transactional interceptor for the given
Qualifier
will open an EntityTransaction
and the outermost @Transactional interceptor for all
EntityManagers will flush and subsequently close all open transactions.
If an Exception occurs in flushing the EntityManagers or any other Exception gets thrown inside the intercepted method chain and not gets catched until the outermost @Transactional interceptor gets reached, then all open transactions will get rollbacked.
If you like to implement your own PersistenceStrategy, then use the standard CDI @Alternative mechanism.
Constructor Summary | |
---|---|
LegacyTransactionalInterceptorStrategy()
|
Method Summary | |
---|---|
protected void |
beginTransaction(javax.persistence.EntityManager entityManager)
|
protected void |
commitTransaction(javax.persistence.EntityManager entityManager)
|
protected void |
endProcess(org.apache.myfaces.extensions.cdi.jpa.impl.EntityManagerEntry entityManagerEntry,
javax.persistence.EntityManager entityManager,
Exception exception)
|
Object |
execute(javax.interceptor.InvocationContext context)
|
protected Transactional |
extractTransactionalAnnotation(javax.interceptor.InvocationContext context)
|
protected Class<? extends Annotation> |
getTransactionQualifier(Transactional transactionalAnnotation)
|
protected Object |
proceedMethodInTransaction(javax.interceptor.InvocationContext context,
org.apache.myfaces.extensions.cdi.jpa.impl.EntityManagerEntry entityManagerEntry,
javax.persistence.EntityManager entityManager,
javax.persistence.EntityTransaction transaction)
|
protected javax.enterprise.inject.spi.Bean<javax.persistence.EntityManager> |
resolveEntityManagerBean(Class<? extends Annotation> qualifierClass)
|
protected void |
rollbackTransaction(javax.persistence.EntityManager entityManager)
|
protected Object |
startProcess(javax.interceptor.InvocationContext context,
org.apache.myfaces.extensions.cdi.jpa.impl.EntityManagerEntry entityManagerEntry,
javax.persistence.EntityManager entityManager)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LegacyTransactionalInterceptorStrategy()
Method Detail |
---|
public Object execute(javax.interceptor.InvocationContext context) throws Exception
execute
in interface InterceptorStrategy
Exception
protected Transactional extractTransactionalAnnotation(javax.interceptor.InvocationContext context)
protected Class<? extends Annotation> getTransactionQualifier(Transactional transactionalAnnotation)
protected javax.enterprise.inject.spi.Bean<javax.persistence.EntityManager> resolveEntityManagerBean(Class<? extends Annotation> qualifierClass)
protected Object startProcess(javax.interceptor.InvocationContext context, org.apache.myfaces.extensions.cdi.jpa.impl.EntityManagerEntry entityManagerEntry, javax.persistence.EntityManager entityManager) throws Exception
Exception
protected Object proceedMethodInTransaction(javax.interceptor.InvocationContext context, org.apache.myfaces.extensions.cdi.jpa.impl.EntityManagerEntry entityManagerEntry, javax.persistence.EntityManager entityManager, javax.persistence.EntityTransaction transaction) throws Exception
Exception
protected void beginTransaction(javax.persistence.EntityManager entityManager)
protected void commitTransaction(javax.persistence.EntityManager entityManager)
protected void rollbackTransaction(javax.persistence.EntityManager entityManager)
protected void endProcess(org.apache.myfaces.extensions.cdi.jpa.impl.EntityManagerEntry entityManagerEntry, javax.persistence.EntityManager entityManager, Exception exception) throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |