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
}
}