There were couple of questions in Enthuware MOCK which I think was wrong.
Identify the true statements regarding transactions in EJB 3.0.
1. It allows Isolation levels to be specified in the deployment descriptor. 2. It allows Isolation levels can only be used programmatically using proprietary database vendor interface. 3. It allows nested transactions. 4. It does not allow a EJB 3.0 Entities to manage their own transactions.
The answer to this was 2, 4. Why is 3 not the correct answer, as it does allow for Nested Transaction. For example, Required-Required New
II) Identify the correct statements about the primary key of an entity? In an entity class hierarchy, the class for which the primary key has been defined must be the root class of the hierarchy and must be an Entity class.
What do you mean by root class?
III)Which of the following tasks would an application assembler perform?
1. Specify the resource manager connection factory references in the deployment descriptor. 2. Configure a resource manager factory. 3. Bind a resource manager connection factory reference used by a bean to actual resource factory. 4. None of these
The answer to this was none of these. The answer should have been 1. As the role of bean provider & application assembler could be considered as same.
Which of the following statements are correct regarding a class hierarchy of Entity classes? 1. The primary key must be defined on the entity that is the root of the entity hierarchy or on a mapped superclass of the entity hierarchy. 2. The primary key must be defined exactly once in an entity hierarchy 3. There can be only one @MappedSuperclass class in a hierarchy and it must be the root class of the hierarchy.
What is the difference between -> Root of entity hierachy & root class of hierarchy?
Your assumption is wrong. See core specs paragraph 13.1.2 Transaction Model:
The Enterprise JavaBeans architecture supports flat transactions. A flat transaction cannot have any child (nested) transactions
Regarding the attributes REQUIRED and REQUIRES_NEW, see the paragraph 22.214.171.124. and 126.96.36.199:
If a client invokes the enterprise bean�s method while the client is associated with a transaction context, the container invokes the enterprise bean�s method in the client�s transaction context.
If the client invokes the enterprise bean�s method while the client is not associated with a transaction context, the container automatically starts a new transaction before delegating a method call to the enterprise bean business method. ... If a client calls with a transaction context, the container suspends the association of the transaction context with the current thread before starting the new transaction and invoking the business method.
... and perhaps you should read the Persistence chapters of EJB in Action. These issues are well described - well enough to pass the exam.
Cheers - Nicolas
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop