What is EJB and Why it cames into Picture

Enterprise beans:These are the Java EE server side components that run inside the ejb container and encapsulates the business logic of an enterprise application

Benefits:
-----------------------
1.EBeans are used for developing distributed,large Application.
2.The client developer can focus only on the representation style of the client as all the business logic of the application is contained in the enterprise beans. The client developer does not bother about the code that implements business logic or the logic to access the databases
3.Reusage can be done to develope new app from existing one.
4.EBeans are portable.

Types:
1. session EJB: Execute single or multiple methods for clients. These types of bean are not shared by client and not persistence. Meaning When client terminates, session ejb terminates and no longer associated with client.

EJB Container and Features of EJB Container

EJB container : It program that runs on the server and provides environment for running the enterprise components. Enterprise beans are used in distributed applications that typically contains the business logic

Features of EJB Container :-
----------------------------------------
1.Transaction Management :
Support for Transaction.It uses the Java Transaction APIs(JTA) to expose the transaction services. JTA, interface which is used to control transactions.

2.Security:
Uses JSE to make more secure app. Enterprise beans add this feature to provide transparent security.

3.Remote Accessibility:
Client(remote) can invoke enterprise bean running on host machine using RPC Remote Procedure Call .Basically RMI- Remote Method Invocation concept.