YouTube Icon

Interview Questions.

Top 29 Enterprise Java Beans (EJB) Interview Questions - Jul 25, 2022

fluid

Top 29 Enterprise Java Beans (EJB) Interview Questions

Q1. What Is Ejbdoclet?

EJBDoclet is an open supply JavaDoc doclet that generates a lot of the EJB associated source files from custom JavaDoc comments tags embedded inside the EJB source file.

Q2. What Is The Difference Between Ejb And Java Be?

EJB is a specification for J2EE server, no longer a product.

Java be can be a graphical issue in IDE.

Q3. What Is Ejb Client Jar File?

An EJB purchaser JAR report is an non-obligatory JAR document which could comprise all the elegance documents that a customer application desires to use the customer view of the enterprise be which are contained within the EJB JAR report. If you decide now not to create a customer JAR report for an EJB module, all of the purchaser interface instructions can be in the EJB JAR document.

Q4. What Are The Call Back Methods In Entity Bean?

Callback techniques allows the box to notify the bean of events in its existence cycle. The callback strategies are defined within the javax.Ejb.EntityBean interface.

Q5. What Is Software Architecture Of Ejb?

Session and Entity EJBs consist of 4 and 5 elements respetively:

@A remote interface (a client interacts with it).

@A home interface (used for developing gadgets and for putting forward commercial enterprise methods).

@A bean object (an object, which surely plays commercial enterprise common sense and EJB-specific operations).

@A deployment descriptor (an XML file containing all information required for maintaining the EJB) or a fixed of deployment descriptors (if you are using a few container-unique features).

Five.A Primary Key magnificence - is handiest Entity bean unique.

Q6. How Many Ejb Objects Are Created For A Bean?

For a Session bean - one EJB object for one bean example.

For entity bean - it depends , if 2 customers are getting access to one row at time then one EJB object is used for each the be different clever for each bean one EJB item.

Q7. What Is Re-entrant. Is Session Be Reentrant. Is Entity Be Reentrant?

If we define the entity bean as being reentrant, a couple of customers can connect to the Entity bean & execute strategies in the entity bean simultaneously. Container takes care of synchronization. If we define the entity bean as non-reentrant and many customers hook up with it concurrently to execute a method, exception is thrown .

 

Q8. What Are Traction Isolation Levels In Ejb?

@Traction_read_uncommitted- Allows a way to read uncommitted facts from a DB(speedy however no longer clever).

@Traction_read_committed- Guarantees that the statistics you are getting has been committed.

@Traction_repeatable_read - Guarantees that all reads of the database might be the same at some stage in the traction (right for examine and update operations).

@Traction_serializable- All the tractions for useful resource are finished serial.

Q9. What Is Ejb Container?

An EJB box is a run-time surroundings that manages one or extra agency be. The EJB field manages the lifestyles cycles of business enterprise bean objects, coordinates distributed tractions, and implements item protection. Generally, every EJB container is supplied by means of an EJB server and incorporates a hard and fast of employer be that run on the server.

 

Q10. What Is The Relationship Between Local Interfaces And Container-controlled Relationships?

Entity be which have container-controlled relationships with different entity be, need to be accessed in the same nearby scope as the ones associated be, and therefore generally offer a neighborhood consumer view. In order to be the goal of a field-controlled courting, an entity bean with box-managed endurance have to offer a nearby interface.

Q11. What Is The New Basic Requirement For A Cmp Entity Bean Class In 2.Zero From That Of Ejb 1.1?

It ought to be abstract magnificence. The box extends it and implements methods which might be required for coping with the relationships

Q12. What Is Ripple Effect?

The system of propagating the modifications within the houses of a server institution during runtime to all the related clones is known as Ripple Effect.

Q13. What Is Ejb Role In J2ee?

EJB technology is the core of J2EE. It enables developers to write reusable and portable server-facet business good judgment for the J2EE platform.

Q14. What Is Deployment Descriptor?

Deployment descriptor is a XML document. That is used to locate the web applicatio n with the aid of box.It consists of the info of respective bean.

Q15. What Is Local Client View?

1.The neighborhood client view specification is simplest available in EJB 2.@Unlike the far flung customer view, the local customer view of a bean is location based.

2.Local client view get admission to to an agency bean calls for each the neighborhood client and the organisation bean that offers the nearby patron view to be in the identical JVM.

Three.The local customer view therefore does no longer provide the location trparency supplied by way of the far flung purchaser view. Local interfaces and nearby home interfaces provide guide for lightweight get entry to from organization bean which might be local clients.

Four.Session and entity be can be tightly couple with their customers, permitting get right of entry to with out the overhead typically associated with remote method calls.

 

Q16. What Is A Server Group?

A server institution is a template of an Application Server(and its contents) i.E, it's miles a logical illustration of the software server. It has the equal structure and attributes as the real Application Server, however it isn't always related to any node, and does not correspond to any real server process running on any node.

Q17. What Is Message Driven Bean?

1.An MDB is essentially a message purchaser which can concentrate to a message vacation spot or a message endpoint and gets activated while a message arrives.

2.By design, MDBs are nameless in nature and consequently can't be directly invoked by a customer.

3.The only way to invoke an MDB is to send a message to the vacation spot or endpoint to which it's miles listening.

@As MDBs are stateless in nature and aren't associated with any specific client, they may be pooled for concurrent processing of messages.

 

Q18. How Can I Access Ejb From Asp?

We can use the Java 2 Platform, Enterprise Edition Client Access Services (J2EETM CAS) COM Bridge 1.Zero, currently downloadable from Sun

Q19. What Is The Difference Between Session And Entity Be?

An entity bean represents persistent worldwide facts from the database; a session bean represents trient consumer-specific records a good way to die while the user disconnects (ends his session). Generally, the consultation be enforce commercial enterprise strategies (e.G. Bank.TrferFunds) that call entity be (e.G. Account.Deposit, Account.Withdraw)

Q20. What Is Enterprise Javabe (ejb) Container?

1.It manages the execution of company be for J2EE programs.

2.Enterprise be and their container run at the J2EE server.

Q21. What Are The Services Provided By Container?

Container offerings are completely depends upon the “dealer implementation”. But more or less maximum of the companies suppots the basic offerings like,

LifeCycle Management - It is Automatic.

Session Management - it is used by Developer coded callback methods…

Traction Management - it's miles used by configuring deployment descriptor (DD) .

Security management - it is utilized by configuring deployment descriptor (DD) .

The different services, if any could be in superior variations, and relies upon on Vendor unique.

Q22. Is It Legal To Have Static Initializer Blocks In Ejb?

Although technically it's miles criminal, static initializer blocks are used to execute a few piece of code before executing any constructor or technique whilst instantiating a class. Static initializer blocks also are commonly used to initialize static fields - which may be illegal in EJB if they're examine/write - In EJB this will be completed by means of consisting of the code in either the ejbCreate(), setSessionContext() or setEntityContext() techniques

Q23. What Is In-reminiscence Replication?

The procedure through which the contents within the memory of 1 physical m/c are replicated in all of the m/c within the cluster is known as in-reminiscence replication.

Q24. Can Entity Be Have No Create() Methods?

Yes. In some cases the information is inserted NOT the usage of Java application, so that you might also handiest need to retrieve the statistics, carry out its processing, however now not create your very own statistics of this kind.

Q25. What Is A Clone?

The copies of a server institution are called Clones. But not like a Server Group Clones are related to a node and are actual server technique strolling in that node.

Q26. How Ejb Invocation Happens?

Steps:

1: Retrieve Home Object reference from Naming Service via JNDI.

2: Return Home Object reference to the purchaser.

3: Create me a new EJB Object thru Home Object interface.

Four: Create EJB Object from the Ejb Object

5: Return EJB Object connection with the patron.

6: Invoke business approach the usage of EJB Object reference.

7: Delegate request to Bean (Enterprise Bean).

 

Q27. What Is Ejb Ql?

1.EJB QL is a Query Language provided for navigation across a community of enterprise be and dependent gadgets defined with the aid of me of field managed staying power.

2.EJB QL is introduced within the EJB 2.Zero specification.

Three.The EJB QL query language defines finder methods for entity be with field managed endurance and is portable throughout bins and endurance managers.

Four.EJB QL is used for queries of two varieties of finder methods:

               Finder techniques which can be defined in the home interface of an entity bean and which go back entity objects.Select methods, which aren't exposed to the consumer, however that are utilized by the Bean Provider to pick chronic values which can be maintained by way of the Persistence Manager or to pick out entity objects which are associated with the entity bean on which the query is defined.

Q28. What Is Remote Client View?

1.The far off purchaser view specification is only to be had in EJB 2.0.

@The far flung patron view of an enterprise bean is location unbiased.

3.A purchaser walking in the same JVM as a bean example makes use of the same API to access the bean as a purchaser jogging in a one-of-a-kind JVM on the same or distinctive gadget.

Remote interface: The far flung interface specifies the far flung commercial enterprise techniques that a customer can call on an corporation bean.

Remote domestic interface: The faraway home interface specifies the methods used by remote clients for finding, growing, and disposing of times of employer bean lessons.

 

Q29. What Are The Types Of Scaling?

There are two kinds of scaling: Vertical Scaling and Horizontal Scaling.

Vertical Scaling - When more than one server clones of an utility server are defined on the equal bodily m/c, it's miles referred to as Vertical Scaling. The objective is to apply the processing strength of that m/c greater efficaciously.

Horizontal Scaling - When Clones of an application server are defined on a couple of bodily m/c, it's far known as Horizontal Scaling. The goal is to apply a couple of much less powerful m/c extra effectively.




CFG