I have the following managed bean:
@ManagedBean
@ViewScoped
public class View {
@EJB
private Bar bar
public void foo() {
bar.do();
bar.do();
bar.do();
}
}
Will this lead to 3 single transactions (one for each bar.do()
call) or will this lead to 1 transaction (foo()
) ?
You will have 3 separate transactions, since EJB container starts the transaction on the beginning of the bean method and ends it when the method is finished (this is done automatically for Container Managed Transactions, with Bean Managed Transactions you do this manually).