There are many ways you can develop enterprise level applications and there are various factors other than the business logic to run the application successfully. EJB promotes component based development with the specification providing the required services (security, transactions etc...) which are to be implemented by the vendor of that implementation. And there are many frameworks/libraries available like Spring/Hibernate combination which you can achieve the most of them. But EJB has been the role model perhaps that other frameworks have adapted (and simplified compared to earlier versions of EJB spec) features from.
How a transaction is secure in EJB ?
When you use transactions the container make sure those are either committed or rolled back so the developer is freed from handling that complexity.
Anandhakrishnan Venkataramanan wrote:I work in banking project . Why we use EJB ? What is the new with EJB ? How a transaction is secure in EJB ?
I am more comfortable with with Java Spring comparatively to EJB architecture as there are lots diffrence ex : for Transaction management
Must use a JTA transaction manager.
Supports transactions that span remote method calls.
Supports multiple transaction environments through its PlatformTransactionManager interface, including JTA, Hibernate, JDO, and JDBC.
Does not natively support distributed transactions—it must be used with a JTA transaction manager.
Supports programmatic bean-managed persistence and declarative container managed persistence.
Provides a framework for integrating with several persistence technologies, including JDBC, Hibernate, JDO, and iBATIS.