JavaBeat Feeds
|
|
|
|
|
|
|
|
|
|
SCBCD Mock Questions - 7
1)You require your EJB to be called from within a transactional context. If the caller is not within a transaction you wish an exception to be thrown. Which Transactional level is the correct one to be used to force this behaviour?
1)Required
2)Mandatory
3)Never
4)TransNewError
5)RequiresNew
2)Which one of the following tag elements must the application assembler use to define the transaction attributes for methods of a bean using container-managed transactional demarcation?
1)method-permission
2)container-transaction
3)ejb-transaction
4)cmp-field
5)container-managed
3)Which of the following statements are correct? [Select all correct answers]
1)Entity beans may only have Bean managed transaction demarcation if they use bean managed persitence.
2)Only Session Beans and Message driven beans can be designed to use Bean Managed Transaction demarcation.
3)Session Beans, Message Driven beans and Entity Beans can be designed to use Bean managed transacational demarcation.
4)Entity beans can only be designed to use Container Managed Transaction demarcation.
5)Session beans cannot use bean managed transactions unless they communicate with message driven beans.
4)Which of the following are requirements of a Message Driven Bean with regards to bean managed transactions?
1)It must be responsible for it's own persistence.
2)A message-driven bean instance must commit a transaction before the onMessage() method returns
3)A message-driven bean must not commit a transaction before the onMessage() method returns.
4)A message-driven bean must use entity beans for asynchronous communication.
5)A message driven bean cannot use bean managed transactions only container managed transactions.
5)To force a rollback on a Container managed transaction you can? [Select all correct answers]
1)Throw an application exception.
2)Call the setRollbackOnly method.
3)Throw an EJBException.
4)Call the rollback method on the UserTransaction.
6)Which of these statements is true regarding the handling of Transactions within the EJB architecture? [Select all correct answers]
1)The Enterprise JavaBeans architecture supports flat transactions. This means that there is no support for nested transactions.
2)Nested transactions are supported in the Enterprise Javabeans Architecture as mandated by the EJB specification.
3)You can specify whether you would like your EJB to participate within nested transactions using the <nested_trans> tag in your deployment descriptor.
4)Although the Enterprise Javabean architecture currently does not support nested transactions it may do in the future.
7)What will happen if the method getRollbackOnly() is called on the MessageDrivenContext and the instance that makes the call is not associated with a transaction?
1)The method will return null.
2)A transaction will be created when the method is invoked.
3)A java.lang.IllegalStateException will be thrown.
4)The method will return the value Boolean.FALSE.
8)What is the purpose of the SessionSynchronization interface?
1)Provides notification of the events of the transactional context it is involved in.
2)Provides a mechanism for synchronizing access to shared sections of memory.
3)Provides a mechanism of synchronizing access to Session Beans.
4)Allows you to reactivate a Stateful Session bean and to synchronise it's data with another Stateful Session bean.
5)Provides a callback from the Container when the Session bean is transferred to another node in it's cluster (this only happens in distributed EJB Containers).
9)Which of the following statements are correct regarding the responsibilities of the application assembler? [Select all correct answers]
1)The application assembler declares required transactional behaviour of enterprise beans in the deployment descriptor, that use bean managed transactional demarcation.
2)The application assembler declares required transactional behaviour of enterprise beans in the deployment descriptor, that use container managed transactional demarcation.
3)The application assembler declares required transactional behaviour of enterprise beans in the deployment descriptor, that use container managed transactional demarcation and beans that use bean managed transactional demarcation.
4)The application assembler cannot control transactional behaviour of beans that use bean managed transaction demarcation.
10)Which one of the following statements regarding enterprise beans with bean-managed transaction demarcation is correct?
1)A bean using Bean Managed Transactions should not call the EJBContext.setRollbackOnly or EJBContext.getRollbackOnly methods.
2)A bean using Bean Managed Transactions should call EJBContext.setRollbackOnly to force a transaction to rollback.
3)A bean using Bean Managed Transactions is not responsible for it's own persistence.
4)A bean using Bean Managed Transactions is an entity bean.
|