@Stateful
@TransactionManagement(BEAN)
public class TestBean implements
Test
{
@Resource
private UserTransaction transaction;
public void someOperation(Timer timer)
{
transaction.begin();
// Do some logic here.
}
}
Which of the following statements are true regarding the above code?
a. The Container will automatically commit the transaction at the end of the method.
b. The Container will throw EJBException since the transaction is not ended.
c. The behavior of the above code will vary from Container to Container.
d. None of the above.
Why b is given as correct answer