|
||||||||||
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.transaction.TransactionalInterceptorStrategy
@Dependent public class TransactionalInterceptorStrategy
Default 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 | |
---|---|
TransactionalInterceptorStrategy()
|
Method Summary | |
---|---|
Object |
execute(javax.interceptor.InvocationContext invocationContext)
|
protected Transactional |
extractTransactionalAnnotation(javax.interceptor.InvocationContext context)
|
protected Class<? extends Annotation> |
getTransactionQualifier(Transactional transactionalAnnotation)
|
protected Exception |
prepareException(Exception e)
This method might get overridden in subclasses to supply better error messages. |
protected javax.enterprise.inject.spi.Bean<javax.persistence.EntityManager> |
resolveEntityManagerBean(Class<? extends Annotation> qualifierClass)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TransactionalInterceptorStrategy()
Method Detail |
---|
public Object execute(javax.interceptor.InvocationContext invocationContext) throws Exception
execute
in interface InterceptorStrategy
Exception
protected Exception prepareException(Exception e)
e
-
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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |