I ma reading the java ee docs and I would like to ask a couple of question to be sure I have understood well what is going on with EJB-Transactions.
1) The docs state that the defaalt TransactionManagement value is CONTAINER and the the default TransactionAttribute value is REQUIRED: If so, am I right that the following (Session) Bean executes all its methods in with CONTAINER managed Transactions and the attribute REQUIRED?
@Stateless
public class MyBean{
public void methodA(){
...
}
public void methodB(){
...
}
}
2) The docs state: Container-managed transactions do not require all methods to be associated with transactions. When developing a bean, you can set the transaction attributes to specify which of the bean’s methods are associated with transactions.
If I omit however the TransactionAttributeType, is it not automatically set to REQUIRED? Is the methodB in the following Bean not associated with a Transaction?
@Stateless
@TransactionManagement(CONTAINER)
public class MyBean{
@TransactionAttribute(MANDATORY)
public void methodA(){
...
}
public void methodB(){
...
}
}