JavaBeat
Search JavaBeat

SCBCD TOPICS

scbcd Home

objectives

mock exams

scbcd mock - 1

scbcd mock - 2

scbcd mock - 3

scbcd mock - 4

scbcd mock - 5

scbcd mock - 6

scbcd mock - 7

scbcd mock - 8

scbcd mock - 9

scbcd mock - 10

scbcd mock - 11

scbcd mock - 12

scbcd mock - 13

scbcd mock - 14

JAVABEAT
home
articles
tips
code junction
forums
OUR NETWORK
javabeat

SCBCD Mock Questions - 6

1)If a system exception is thrown by a bean instance method, which of the following responsibilities belong to neither the bean provider nor the container provider? [Select all correct answers]

1)Logging of errors.
2)Garbage collection.
3)Releasing of managed resources.
4)Monitoring the logs of non-application exceptions.
5)Discarding of bean instances.

2)Under which circumstances will an entity bean throw a javax.ejb.NoSuchEntityException? [Select all correct answers]

1)To indicate that the underlying entity has been removed from the database.
2)When a client of a stateless session bean removes the entity from the database.
3)The entity bean will typically throw the javax.ejb.NoSuchEntityException from within the ejbCreate() method.
4)The entity bean will typically throw the javax.ejb.NoSuchEntityException from within the ejbStore() method.
5)The javax.ejb.NoSuchEntityException does not exist.

3)Given the following scenario, which of the following actions are performed by the container? [Select all correct answers]

The bean method
* Is defined on an enterprise bean with container-managed transaction.
* Is a business method.
* Runs in the context of a transaction that the container started.
* Throws an application exception.
* Does not mark the transaction for rollback.
1)The transaction is rolled back.
2)The transaction is committed.
3)The bean instance is discarded.
4)The application exception is re-thrown.
5)javax.ejb.EJBException is thrown.

4)What will the container do when a bean managed message driven bean throws a system exception? [Select all correct answers]

1)Log the system exception.
2)Mark the transaction for rollback.
3)The container will discard the message driven bean instance and will not invoke any business methods or container callbacks on the instance.
4)The container will commit the transaction unless the deployment descriptor specifies otherwise
5)The client will receive a RemoteException.

5)Which of the following statements are true when a session bean's client receives a java.rmi.RemoteException? [Select all correct answers]

1)The client will never receives a java.rmi.RemoteException.
2)The client calls the session bean from another JVM.
3)The client calls the session bean from within the same JVM.
4)The container always throws a java.rmi.RemoteException if the container performs a transaction rollback.
5)The throws clauses of all methods in the remote home and component interface must declare a java.rmi.RemoteException.

6)How will the EJB container handle exceptions thrown by a business method of a bean with container managed transaction demarcation? [Select all correct answers]

1)If the instance called setRollbackOnly(), the EJB container will rollback the transaction.
2)If the instance did not call setRollbackOnly(), the EJB container will commit the transaction.
3)The EJB container will throw a RemoteException.
4)If the bean represents an entity bean, it will remove the entity from the datasource.
5)If the bean represents a session bean, the bean will be removed from the pool.

7)Which of the following exceptions are considered to be application exceptions? [Select all correct answers]

1)javax.ejb.CreateException
2)javax.ejb.RemoveException
3)java.rmi.RemoteException
4)javax.ejb.ObjectNotFoundException extends java.lang.Exception
5)javax.ejb.ObjectNotFoundException extends java.lang.RuntimeException

8)Which of the following statements regarding exception handling in EJBs are true? [Select all correct answers]

1)The bean provider is responsible for performing any clean up actions before throwing a non-application exception.
2)The container always discards an enterprise bean instance if one of its business methods throws a non-application exception.
3)A local client cannot continue a transaction if javax.ejb.TransactionRolledbackLocalException is received.
4)A transaction is automatically rolled back by the container if the client initiated the transaction and the bean's business method resulted in an application exception.
5)Message-driven bean methods cannot throw application exceptions to the client.

9)Which of the following exceptions are not RuntimeExceptions? [Select all correct answers]

1)javax.ejb.NoSuchEntityException
2)javax.ejb.EJBException
3)javax.ejb.NoSuchObjectLocalException
4)javax.ejb.FinderException
5)javax.ejb.DuplicateKeyException

10)Which of the following statements regarding message-driven bean exception handling are true? [Select all correct answers]

1)Message-driven beans throw both application exceptions and system exceptions.
2)If a system exception is thrown by a method, the transaction is always rolled back by the container.
3)If a system exception is thrown by a method, the bean instance is always discarded.
4)If a system exception is thrown by a method, the client does not receive the exception.
5)If an application exception is thrown by a method, the client receives the exception.

SCBCD Mock Questions 6 - Answers


Sponsors
Webmaster Hosting Forum
Java Jobs
MyVideoLib
India News
Internet Advances
Latest QnA
SCJD Tips
When we start a thread by applying start() method on it ,how does it knows that to execute run()method?
About Wrapper class in Java
How to configure weblogic 7.0 in MyEclipse?
Static Block and Static Initializer in Java

JavaBeat Media (2004-2008), India
javabeat | planetoss | links directory | advertise
Copyright (2004 - 2008), JavaBeat