private boolean isRollbackOnlyAllowed ( ) { switch ( state ) { case PRE_CREATE : case AFTER_COMPLETION : return false ; case CREATING : return isLifecycleCallbackGlobalTx ( LifecycleInterceptorWrapper . MID_POST_CONSTRUCT ) ; case ACTIVATING : return isLifecycleCallbackGlobalTx ( LifecycleInterceptorWrapper . MID_PRE_PASSIVATE ) ; case PASSIVATING : return isLifecycleCallbackGlobalTx ( LifecycleInterceptorWrapper . MID_PRE_PASSIVATE ) ; case REMOVING : return isLifecycleCallbackGlobalTx ( LifecycleInterceptorWrapper . MID_PRE_DESTROY ) ; case DESTROYED : return destroying && isLifecycleCallbackGlobalTx ( LifecycleInterceptorWrapper . MID_PRE_DESTROY ) ; } return true ; }
Returns true if rollback only methods can be called in the current state .