These are some questions for the EJB interviews. Although you may have a good knowledge of EJB, you must revise the topics through answering questions. As EJB interviews are tough because the interviewers try to find the most talented developers in this field. So, to help you, we share some important questions that may help you in your interviews.
EJB stands for Enterprise java bean is a server-side software that is used to construct the module of enterprise software. It works on the container or we can say application server to scattered and business level application. Container plays a supporting function to transaction management and security that helps the developers and users to work on it easily. It is simple for them to concentrate on business logic.
The various types of EJB are: -
Entity beam is divided into two types: -
Here are some advantages of the Java beam:
Timer service is a method to construct a scheduled program. @Timeout is used in EJB 3.0 to maintain the EJB services in the beams such as stateless session beam and Message Driven beam too. Example of timer service is the generation of salary slips on any particular date of the month.
It is not possible to have threading in EJB because Container maintains and controls the processing in EJB. And if threading is allowed in this, the container will be affected. As it is discussed earlier, EJB is designed to Lower the work on the developer and make them easier to just focus on business logic. EJB is not built to control the system or implementation works so container itself manage the thread.
Session facade is the design pattern used as a wrapper class. It is very important for the development of enterprise applications. It increases the performance of the system by minimize the network calls. Although it is executed as a high-level element (Session EJB it consists the interaction between low-level elements (Entity EJB). It also allowed the accessing of the client into bean elements.
The transaction is the group of employment which works fully or none to integrate and maintain the data. The transaction has special properties like atomicity, consistency, integrity, durability together calls them ACID. The completed transaction is Commitment of successful performance over unsuccessful performance.
Transaction management can be done in two methods.
Here are some transaction attributes
Support is the default transaction value of EJB.
The query language is used to provide the navigation with the help of network and consists beans. Container-managed persistence determined the enterprise beans. EJB QL emerged in EJB 2.0. It is motile through the persistence manager that helps to determine methods of the finder. It helps the two kinds of the finder system. EJB QL is not good than SQL as it works as an abstract schema.
Creation of stateless EJB is done in simple steps:
Here are some annotations that are provided by the EJB.
Here is the list of callback annotation for an entity bean:
On Occurrence of Application exception: EJB return the exception to client as it is intercepted. The method EJBContext().setRollBackOnly() specify that whether the transaction it should be rolled or not.
On Occurrence of System Exception: Here EJB first intercepts the transaction, rollback it and then initiate the clean-up tasks. It converts the exception into RemoteException before sending to the client.
Never Miss an Articles from us.