1 . A stateless session bean must commit a transaction before a business method?
- True
- False
2 . A message-driven bean must commit a transaction before a business method?
- True
- False
3 . A stateful session bean must commit a transaction before a business method?
- True
- False
4 . By default, What is the value of the transaction atrribute for a method of a bean with CMT?
- NotSupported
- Required
- RequiresNew
- Supports
5 . Which of the following statements are valid?
- 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’
- Bean Provider may use either annotations or deployment descriptor to specify the transaction attributes, cannot use the both at same time
- Bean Provider can use annotations and deployment descriptor to specify the transaction attributes. If he uses both deployment descriptor will override the annotations
- 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?
- Bean Provider
- Application Assembler
- Deployer
- System Administrator
7 . Which of the following TransactionAttribute values can be be use for MDB’s message listener methods?
- a)REQUIRED
- b)MANDATORY
- c)NOT_SUPPORTED
- d)REQUIRES_NEW
8 . Which of the following TransactionAttribute values can be be used for enterprise bean’s timeout call back methods?
- MANDATORY
- REQUIRES
- REQUIRES_NEW
- NOT_SUPPORTE
9 . Which of the following TransactionAttribute values can be be used for enterprise bean when it implements javax.ejb.SessionSynchronization?
- REQUIRED
- MANDATORY
- SUPPORTS
- REQUIRES_NEW
- NOT_SUPPORTED
- NEVER
10 . Which of the following statements are correct?
- TransactionAttribute annotation is used to specify a transaction attribute
- The value of the TransactionAttribute annotation is given by the enum TransactionAttributeEnum
- Transaction attributes of the methods can be specified in the class, the business methods of the class or both
- 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.