EJB Mock Test



This section presents you various set of Mock Tests related to EJB Framework. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.

Questions and Answers

EJB Mock Test IV

Answer : A

Explaination

ACID stands for Atomic, Consistent,Isolated and Durable.

Answer : A

Explaination

Atomic - If any of work item fails, the complete unit is considered failed. Success meant all items executes successfully.

Answer : A

Explaination

REQUIRED - Indicates that business method has to be executed within transaction otherwise a new transaction will be started for that method.

Answer : B

Explaination

REQUIRES_NEW - Indicates that a new transaction is to be started for the business method.

Answer : D

Explaination

NOT_SUPPORTED - Indicates that business method should not be executed as part of transaction.

Answer : A

Explaination

MANDATORY - Indicates that business method will execute as part of transaction otherwise exception will be thrown.

Answer : B

Explaination

NEVER - Indicates if business method executes as part of transaction then an exception will be thrown.

Answer : A

Explaination

Start - When to start a transaction in a business method.

Answer : B

Explaination

Success - Identify success scenario when a transaction is to be committed.

Answer : C

Explaination

Failed - Identify failure scenario when a transaction is to be rollback.

Answer : B

Explaination

RolesAllowed - Indicates that a method can be accessed by user of role specified. Can be applied at class level resulting which all methods of class can be accessed buy user of role specified.

Answer : A

Explaination

JNDI stands for Java Naming and Directory Interface.

Answer : D

Explaination

JNDI stands for Java Naming and Directory Interface. It is a set of API and service interfaces. Java based applications use JNDI for naming and directory services.

Answer : D

Explaination

EJB 3.0, ejb query language is quite handy to write custom queries without worrying about underlying database details. It is quite similar to HQL, hibernate query language and is often referred by name EJBQL.

Answer : B

Explaination

Any exception which is not caused by business logic or business code. RuntimeException, RemoteException are SystemException will be treated as system level exception.

Answer : C

Explaination

When Application Exception occurs, ejb container intercepts the exception but returns the same to the client as it is. It does not roll back the transaction unless it is specified in code by EJBContext.setRollBackOnly() method.

Answer : C

Explaination

When System Exception occurs, ejb container intercepts the exception, rollbacks the transaction and start the clean up tasks. It wraps the exception into RemoteException and throws it to the client.

Answer Sheet

Question Number Answer Key
1 A
2 A
3 B
4 C
5 D
6 A
7 B
8 C
9 D
10 A
11 B
12 A
13 B
14 C
15 A
16 B
17 C
18 D
19 A
20 D
21 D
22 A
23 B
24 C
25 C
ejb_questions_answers.htm
Advertisements