- EJB Tutorial
- EJB - Home
- EJB - Overview
- EJB - Environment Setup
- EJB - Create Application
- EJB - Stateless Bean
- EJB - Stateful Bean
- EJB - Persistence
- EJB - Message Driven Beans
- EJB - Annotations
- EJB - Callbacks
- EJB - Timer Service
- EJB - Dependency Injection
- EJB - Interceptors
- EJB - Embeddable Objects
- EJB - Blobs/Clobs
- EJB - Transactions
- EJB - Security
- EJB - JNDI Bindings
- EJB - Entity Relationships
- EJB - Access Database
- EJB - Query Language
- EJB - Exception Handling
- EJB - Web Services
- EJB - Packaging Applications
- EJB Useful Resources
- EJB - Quick Guide
- EJB - Useful Resources
- EJB - Discussion
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.
EJB Mock Test IV
Q 1 - What ACID stands for?
A - Atomic, Consistent,Isolated and Durable
B - Acurate, Correct,Isolated and Durable
Answer : A
Explaination
ACID stands for Atomic, Consistent,Isolated and Durable.
Q 2 - Which of the following is correct about a Atomic transaction in EJB?
B - A transaction must keep the system in consistent state.
C - Each transaction executes independent of any other transaction.
D - Transaction should survive system failure if it has been executed or committed.
Answer : A
Explaination
Atomic - If any of work item fails, the complete unit is considered failed. Success meant all items executes successfully.
Q 3 - Which of the following is correct about a Consistent transaction in EJB?
B - A transaction must keep the system in consistent state.
C - Each transaction executes independent of any other transaction.
D - Transaction should survive system failure if it has been executed or committed.
Answer : B
Explaination
Consistent - A transaction must keep the system in consistent state.
Q 4 - Which of the following is correct about a Isolated transaction in EJB?
B - A transaction must keep the system in consistent state.
C - Each transaction executes independent of any other transaction.
D - Transaction should survive system failure if it has been executed or committed.
Answer : C
Explaination
Isolated - Each transaction executes independent of any other transaction.
Q 5 - Which of the following is correct about a Durable transaction in EJB?
B - A transaction must keep the system in consistent state.
C - Each transaction executes independent of any other transaction.
D - Transaction should survive system failure if it has been executed or committed.
Answer : D
Explaination
Durable - Transaction should survive system failure if it has been executed or committed.
Q 6 - Which of the following is correct about a REQUIRED attrribute of Container Managed Transactions in EJB?
B - Indicates that a new transaction is to be started for the business method.
C - Indicates that business method will execute as part of transaction.
D - Indicates that business method should not be executed as part of transaction.
Answer : A
Explaination
REQUIRED - Indicates that business method has to be executed within transaction otherwise a new transaction will be started for that method.
Q 7 - Which of the following is correct about a REQUIRES_NEW attrribute of Container Managed Transactions in EJB?
B - Indicates that a new transaction is to be started for the business method.
C - Indicates that business method will execute as part of transaction.
D - Indicates that business method should not be executed as part of transaction.
Answer : B
Explaination
REQUIRES_NEW - Indicates that a new transaction is to be started for the business method.
Q 8 - Which of the following is correct about a SUPPORTS attrribute of Container Managed Transactions in EJB?
B - Indicates that a new transaction is to be started for the business method.
C - Indicates that business method will execute as part of transaction.
D - Indicates that business method should not be executed as part of transaction.
Answer : C
Explaination
SUPPORTS - Indicates that business method will execute as part of transaction.
Q 9 - Which of the following is correct about a NOT_SUPPORTED attrribute of Container Managed Transactions in EJB?
B - Indicates that a new transaction is to be started for the business method.
C - Indicates that business method will execute as part of transaction.
D - Indicates that business method should not be executed as part of transaction.
Answer : D
Explaination
NOT_SUPPORTED - Indicates that business method should not be executed as part of transaction.
Q 10 - Which of the following is correct about a MANDATORY attrribute of Container Managed Transactions in EJB?
B - Indicates that a new transaction is to be started for the business method.
C - Indicates that business method will execute as part of transaction.
D - 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.
Q 11 - Which of the following is correct about a NEVER attrribute of Container Managed Transactions in EJB?
B - Indicates if business method executes as part of transaction then an exception will be thrown.
C - Indicates that business method will execute as part of transaction.
D - Indicates that business method should not be executed as part of transaction.
Answer : B
Explaination
NEVER - Indicates if business method executes as part of transaction then an exception will be thrown.
Q 12 - Which of the following is correct about a Start attrribute of Bean Managed Transactions in EJB?
A - When to start a transaction in a business method.
B - Identify success scenario when a transaction is to be committed.
C - Identify failure scenario when a transaction is to be rollback.
Answer : A
Explaination
Start - When to start a transaction in a business method.
Q 13 - Which of the following is correct about a Success attrribute of Bean Managed Transactions in EJB?
A - When to start a transaction in a business method.
B - Identify success scenario when a transaction is to be committed.
C - Identify failure scenario when a transaction is to be rollback.
Answer : B
Explaination
Success - Identify success scenario when a transaction is to be committed.
Q 14 - Which of the following is correct about a Failed attrribute of Bean Managed Transactions in EJB?
A - When to start a transaction in a business method.
B - Identify success scenario when a transaction is to be committed.
C - Identify failure scenario when a transaction is to be rollback.
Answer : C
Explaination
Failed - Identify failure scenario when a transaction is to be rollback.
Q 15 - Which of the following is correct about a DeclareRoles attrribute of Container Managed Transactions in EJB?
A - Indicates that class will accept those declared roles. Annotations are applied at class level.
Answer : A
Explaination
DeclareRoles - Indicates that class will accept those declared roles. Annotations are applied at class level.
Q 16 - Which of the following is correct about a RolesAllowed attrribute of Container Managed Transactions in EJB?
A - Indicates that class will accept those declared roles. Annotations are applied at class level.
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.
Q 17 - Which of the following is correct about a PermitAll attrribute of Container Managed Transactions in EJB?
A - Indicates that class will accept those declared roles. Annotations are applied at class level.
Answer : C
Explaination
PermitAll - Indicates that business method is accessible to all. Can be applied at class as well as at method level.
Q 18 - Which of the following is correct about a DenyAll attrribute of Container Managed Transactions in EJB?
A - Indicates that class will accept those declared roles. Annotations are applied at class level.
Answer : D
Explaination
DenyAll - Indicates that business method is not accessible to any of user specified at class or at method level.
Q 19 - What JNDI stands for?
A - Java Naming and Directory Interface
B - Joint Naming and Directory Interface
Answer : A
Explaination
JNDI stands for Java Naming and Directory Interface.
Q 20 - Which of the following is true about JNDI?
A - JNDI stands for Java Naming and Directory Interface.
B - It is a set of API and service interfaces.
C - Java based applications use JNDI for naming and directory services.
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.
Q 21 - Which of the following is true about EJBQL EJB?
A - EJBQL stand for EJB Query Language.
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.
Q 22 - Which of the following is true about Application level exception in EJB?
Answer : A
Explaination
If business rule is voilated or exception occurs while executing the business logic will be treated as application level exception.
Q 23 - Which of the following is true about System level exception in EJB?
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.
Q 24 - Which of the following is true about exceptions handling by EJB Container?
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.
Q 25 - Which of the following is true about exceptions handling by EJB Container?
B - EJB Container wraps the exception into RemoteException and throws it to the client.
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 |
To Continue Learning Please Login
Login with Google