Class JpaTransactionalInterceptor


  • @Interceptor
    @Priority(2000)
    public class JpaTransactionalInterceptor
    extends Object
    Runs a JpaTransactional method as a unit of work, so the method body needs no transaction handling of its own.
    Since:
    8.5.6
    Author:
    Norman Lorenz
    • Method Detail

      • runInTransaction

        public Object runInTransaction​(javax.interceptor.InvocationContext context)
                                throws Exception
        Runs the intercepted method in a transaction, which is committed when it returns and rolled back when it throws.
        Parameters:
        context - the invocation to run.
        Returns:
        whatever the intercepted method returns.
        Throws:
        Exception - whatever the intercepted method throws.