EJB - Services that the EJB container offers to the application developer

Explain the various services that the EJB container offers to the application developer.

Component Pooling :

- An EJB component is a server component that provides methods with business logic in distributed applications.

- These methods are to be handled using Enterprise Java Beans.

- These beans are maintained by the EJB container.

- The container maintains a pool of enterprise beans in order to respond to the client requests.

Lifecycle Management :

- The EJB container, based on the server load, automatically increases and reduces the number of available bean instances.

Database Connection Pooling :

- By using a single user login and password to access the entire database system is known as connection pooling.

- This one single login and password will have full access to the database.

- Using the connection pooling, the performance of executing database commands can be enhanced.

- Tearing down the connections is more costly than executing the commands and needs hard coding.

- These flaws are handled properly by having a connection pool.

- Connections are available for one database, so that new connections does not need to be established. If the number of connections exceed the limit, a queue of instances can be made.

Transaction Management :

- A transaction is a subtask that can execute at once at a time.

- To make a successful transaction management, every transaction must be executed successfully.

- EJB provides two types of transaction management:

1. Container-Managed Transactions (CMT) : CMT is all about the commitment or rolling back the transaction on behalf of the bean.

2. Bean-Managed Transactions (BMT) : BMT is all about to have overall control on transactions that can be managed by the client or in the bean itself, if the transaction is to be managed by the session.

Authentication :

- Container encapsulates EJBs and acts as its security manager.

- EJB supports authentication and role-driven access control.

- An EJB container implements authentication mechanism which are often rely on the web container.

- Bean developer should never code for authentication.

Persistence :

- The container provides persistent services such as, transactions, security, concurrency, and naming at runtime.

- The persistence feature of the container is associated with the entity bean to generate various methods to perform the data persistence for the entity bean instances.

- The generated methods involve in transferring the data between entity bean instances and the specific resource manger.

- This persistence is done at runtime.

- The container is capable of managing the mapping between the relationships at runtime and manages the referential integrity.

Client Session Management :

- Client session management is implementing the business logic for a client.

- This is performed by the Session Bean. For example, a session bean can perform various calculations for employee payroll application, processing orders, encrypting and decrypting data, data validation etc. for a client.

- The container manages to make the session beans reside, as long as the client’s session using them.

Explain the various services that the EJB container offers to the application developer.

- There are four types of services offered by the EJB container, described as follows:

1. Life Cycle Management :

- JRun is an application server that works for building and deploying server-side Java applications.

- It automatically increases and reduces the number of available bean instances so that there is not much load on the current server.

2. Security :

- EJB support authentication and role-driven access control thus providing security.

3. Session Management :

- The Server JRun maintains state for stateful session beans and entity beans.

- The state for session bean is maintained through passivation and activation callback methods, while for the entity beans it is maintained by entity-bean callback methods.

4. Transaction :

- EJB provides 2 types of transactions:

1. Container-managed transactions
2. Bean-managed transactions
What is the difference between EJB and Java beans?
Difference between EJB and Java beans - Java Beans: Java beans are reusable components that can be used for customized user objects....
What’s new in the EJB 2.0 specification?
New in the EJB 2.0 specification - The following are the differences specified by Sun in EJB 2.0 Local interfaces, which improve the efficiency of intra-container entity relationships..
What is the difference between EAR, JAR and WAR file?
Difference between EAR, JAR and WAR file - .jar files: These files have .jar extension. A .jar file contains .class files, resources like .java and property files...
Post your comment