@Dependent @Alternative public class LegacyTransactionalInterceptorStrategy extends Object implements PersistenceStrategy
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 and Description |
---|
LegacyTransactionalInterceptorStrategy() |
Modifier and Type | Method and Description |
---|---|
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) |
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) |
public LegacyTransactionalInterceptorStrategy()
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) throws Exception
Exception
protected void beginTransaction(javax.persistence.EntityManager entityManager)
protected void commitTransaction(javax.persistence.EntityManager entityManager)
protected void rollbackTransaction(javax.persistence.EntityManager entityManager)
Copyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.