OCPJBCD Mock Exam – 3

SHARE & COMMENT :

1 . A stateless session bean must commit a transaction before a business method?

  1. True
  2. False

2 . A message-driven bean must commit a transaction before a business method?

  1. True
  2. False

3 . A stateful session bean must commit a transaction before a business method?

  1. True
  2. False

4 . By default, What is the value of the transaction atrribute for a method of a bean with CMT?

  1. NotSupported
  2. Required
  3. RequiresNew
  4. Supports

5 . Which of the following statements are valid?

  1. If a TransactionAttribute annotation is not specified for a method of a bean with CMT, the value of the transaction attribute for the method is defined as ‘Not Required’
  2. Bean Provider may use either annotations or deployment descriptor to specify the transaction attributes, cannot use the both at same time
  3. Bean Provider can use annotations and deployment descriptor to specify the transaction attributes. If he uses both deployment descriptor will override the annotations
  4. If the transaction attribute is not specified in deployment descriptor and annotations, then the value is ‘Required’

6 . Who is allowed to override the transaction attribute in the deployment descriptor?

  1. Bean Provider
  2. Application Assembler
  3. Deployer
  4. System Administrator

7 . Which of the following TransactionAttribute values can be be use for MDB’s message listener methods?

  1. a)REQUIRED
  2. b)MANDATORY
  3. c)NOT_SUPPORTED
  4. d)REQUIRES_NEW

8 . Which of the following TransactionAttribute values can be be used for enterprise bean’s timeout call back methods?

  1. MANDATORY
  2. REQUIRES
  3. REQUIRES_NEW
  4. NOT_SUPPORTE

9 . Which of the following TransactionAttribute values can be be used for enterprise bean when it implements javax.ejb.SessionSynchronization?

  1. REQUIRED
  2. MANDATORY
  3. SUPPORTS
  4. REQUIRES_NEW
  5. NOT_SUPPORTED
  6. NEVER

10 . Which of the following statements are correct?

  1. TransactionAttribute annotation is used to specify a transaction attribute
  2. The value of the TransactionAttribute annotation is given by the enum TransactionAttributeEnum
  3. Transaction attributes of the methods can be specified in the class, the business methods of the class or both
  4. Transaction attribute may be specified on the method of the bean class to override the transaction attribute value specified in a class

Answers

1 : 1 is correct.

2 : 1 is correct.

3 : 2 is correct.

4 : 2 is correct.

5 : 3 & 4 is correct.

6 : 2 is correct.

7 : 1 & 3 is correct.

8 : 2,3 & 4 is correct.

9 : 1,2 & 4 is correct.

10 : 1,3 & 4 is correct.
Explanation: The value of the TransactionAttribute annotation is given by the enum TransactionAttributeEnum.

Comments

comments

About Krishna Srinivasan

He is Founder and Chief Editor of JavaBeat. He has more than 8+ years of experience on developing Web applications. He writes about Spring, DOJO, JSF, Hibernate and many other emerging technologies in this blog.

Speak Your Mind

*

Close
Please support the site
By clicking any of these buttons you help our site to get better