A developer implements a system in which transfers of goods are monitored. Each transfer needs a unique ID for tracking purposes. The unique ID is generated by
an existing system which is also used by other applications. For perfomance reasons, the transaction that gets the unique ID should be as short as possible. The
scenario is implemented in four steps which are implemented in four business methods in a CMT session bean:
1.checkGoods Checks goods in a database
2.getUniqueld Retrieve the unique ID
3.checkAmount Checks the amount in a non-transactional system
4.storeTransfer Stores the transfer in a database as part of the calling transaction.
These methods are called by the addTransfer method of a second CMT session bean in the following order:
checkGoods, getUniqueld, checkAmount, storeTransfer
Assuming no other transaction-related metadata, which is the correct set of transaction attributes for the methods in the session beans?
A developer writes a stateless session bean FooBean with one remote business interface FooRemote containing one business method foo. Method foo takes a
single parameter of application-defined type MyData.
11. public class MyData implements java.io.Serializable {
12. int a;
13. }
Method foo is implemented within the FooBean class as:
Given two entitles with a many-to-many bidirectional association between them:
11. @Entity public class Employee {
12. Collection projects;
13. //more code here
14. }
and
11. @Entity public class Project{
12. Set
14. }
13. //more code here emps;
What set of annotations correctly defines the association?
A session bean calls the setRollbackOnly method on the EJBContext interface within a business method with an active transaction. Which two are correct? (Choose
two.)
FooBean and BarBean are both EJB 3.0 stateless session beans with container-managed transaction demarcation. All business methods in the two beans have
transaction attribute REQUIRED. The business method foo in FooBean invokes the business method bar in BarBean.
Given:
10. public class BarBean {
11. public void bar() {
12. throw new EJBException("unexpected error...");
13. }
Which statement is true about the result of this method invocation assuming execution reaches Line 12?
A developer writes a stateless session bean FooBean and uses its deployment descriptor to declare a local ejb dependency on a stateful session bean in the same
ejB. jar.
Which environment annotation, when declared within the FooBean bean class, is equivalent to the ejB. local-ref shown above?