Free Cheat-test Samples and Demo Questions Download
Adobe exams Adobe
Apple exams Apple
Avaya exams Avaya
Check Point exams Check Point
Cisco exams Cisco
Citrix exams Citrix
CIW exams CIW
CompTIA exams CompTIA
EC-Council exams EC-Council
EMC exams EMC
Exin exams Exin
Fortinet exams Fortinet
Hitachi exams Hitachi
HP exams HP
IBM exams IBM
Isaca exams Isaca
ISC exams ISC
Juniper exams Juniper
LPI exams LPI
McAfee exams McAfee
Microsoft exams Microsoft
Oracle exams Oracle
PMI exams PMI
Riverbed exams Riverbed
SNIA exams SAP
Sun exams SAS
Symantec exams Symantec
VMware exams VMware
All certification exams

Sun 310-091 Exam -

Free 310-091 Sample Questions:

1. The ejb-jar file format is a contract between which two EJB role pairs? (Choose two.)
A. Deployer and System Administrator
B. Application Assembler and Deployer
C. Bean Provider and Application Assembler
D. Bean Provider and EJB Container Provider
E. EJB Server Provider and EJB Container Provider
F. Application Assembler and EJB Container Provider
Answer: B, C

2. A session bean's business method throws an exception during execution.
Which two are responsibilities of the Bean Provider when throwing the exception? (Choose two.)
A. For application exceptions, ensure that if the current transaction commits there will be no loss of data integrity.
B. For application exceptions, ensure that the current transaction will commit.
C. For system errors, when the client is remote, throw a java.rmi.RemoteException that wraps the original exception.
D. For checked exceptions from which the bean cannot recover, throw an EJBException that wraps the original exception.
Answer: A, D

3. A session bean's business method invokes UserTransaction.setRollbackOnly and receives an IllegalStateException. Under which circumstance can this happen?
A. The bean is using bean-managed transactions regardless of whether there is an active transaction.
B. There is no circumstance that would cause setRollbackOnly to throw an IllegalStateException.
C. The bean is using bean-managed transaction demarcation, and UserTransaction.begin has NOT been invoked.
D. The setRollbackOnly method is invoked within a bean-managed transaction, and UserTransaction.commit has NOT been invoked.
Answer: C

4. A developer wants to create a Java Persistence query that restricts the results of an age-based query. Specifically, the developer wants to select everyone who is NOT a teenager.
(A teenager is someone who is 13, 14, 15, 16, 17, 18, or 19 years old.)
Which expression in the query's WHERE clause is correct?
A. WHERE p.age NOT BETWEEN 12 and 20
B. WHERE p.age NOT BETWEEN 13 and 20
C. WHERE p.age NOT BETWEEN 12 and 19
D. WHERE p.age NOT BETWEEN 13 and 19
Answer: D

5. A Java Persistence application uses entities mapped to tables from two datasources in the same transaction.
What statement is correct?
A. This is NOT possible.
B. The entities must be packaged into two persistence units.
C. The entities can be packaged into a single persistence unit
D. The entities must be packaged using two different persistence.xml files.
Answer: B

6. A developer wants to create a business interface for both local and remote usage. For performance reasons the remote interface should NOT be called by a client in the same JVM.
Which statement is required to accomplish this, assuming there is no deployment descriptor?
A. The business methods are defined in one interface which must be annotated with both @Local and @Remote .
B. The business methods are defined twice in one interface. One method is annotated with @Local and the other is annotated with @Remote .
C. The business methods are defined in a common interface by two other interfaces which are annotated with @Local and @Remote respectively. The bean implements the super interface.
D. The business methods are defined in a common interface. It is extended by two interfaces, annotated with @Local and @Remote respectively. Both interfaces are implemented by the bean class.
Answer: D

7. A developer is writing a stateless session bean that is obtaining a transaction-scoped entity manager using injection and assumes the application defines one persistence unit.
Which declaration is correct?
A. @Resource EntityManager em;
B. @PersistenceUnit EntityManager em;
C. @PersistenceContext EntityManager em;
D. @PersistenceUnit("TransactionScoped") EntityManager em;
Answer: C

8. Within a JMS message-driven bean, which two lifecycle methods may be invoked by the container? (Choose two.)
A. AfterBegin
B. PreDestroy
C. PrePassivate
D. PostActivate
E. PostConstruct
F. AfterCompletion
Answer: B, E

9. Which statement about the Java Persistence lifecycle state detached is NOT correct?
A. Entities can become detached by an entity manager operation.
B. In an extended transaction context entities become detached after the transaction has been commited.
C. A detached entity instance is an instance with a persistent identity that is NOT associated with a persistence context.
D. In a transaction scoped persistence context entities returned by the queries executed without an active transaction are detached.
Answer: B

10. Consider a deep inheritance hierarchy consisting of Java Persistence entity classes, non-entities, and mapped superclasses.
Which statement is correct, assuming NO mapping descriptor is present?
A. An entity class must NOT inherit from a non-entity class.
B. An entity class must NOT be extended by a non-entity class.
C. Only the root class in an inheritance hierarchy can be annotated wtith @MappedSuperclass .
D. The primary key must either be defined in the topmost entity class of the inheritance hierarchy or it can be defined in a superclass if this class is annotated as @MappedSuperclass .
Answer: D

© 2014, All Rights Reserved