EJB and methods within the same class

0

I'm studying EJB and I had two questions regarding the type of transaction:

  • The% w / w of the following code has metodo1 , will TransactionAttributeType also assume the same behavior as metodo2 since it is being called within metodo1 or assume default behavior?

  • If metodo1 is a private method, it will assume some type of metodo2 ?

  • @Stateless
    @TransactionManagement(TransactionManagementType.CONTAINER)
    public class Classe1()
    {
        @TransactionAttribute(TransactionAttributeType.REQUIRESNEW)
        public Int metodo1(){
            //chama outro método
            int soma = metodo2();
            return soma;
        }
    
        public Int metodo2(){
            //faz algo
        }
    }
    
        
    asked by anonymous 07.11.2018 / 14:41

    0 answers