EJB
1. Scalability
- Specification requires EJB servers provide pooling both for
database connections and EJB instances
- Java Database Connectivity (JDBC) 2.0 standard extension is
essential for scalability
- The container must prevent other transactions from entering
the EJB until the first transaction commits or aborts
- Caching of entity EJBs is useful since they can be easily
retrieved if they are requested again shortly after being returned to the pool
2. State Management
- Stateless session beans are equivalent to typical COM+
components and retain no state between method calls
- Stateful session beans retain state between method calls
until container passivates them, such as shopping cart
- An entity bean is stateful and that state persists over
time
- Using Container Managed Persistence (CMP) for entity beans
can make state management easier
- Simple entity beans will map to a single row in a single
database table
- Persistence Manager facilitates complex data mapping to
ensure CMP entity beans are truly portable
3. Simpler Security
- Based on underlying J2EE platform, which uses the security
infrastructure of the underlying OS
- Role-based, same as COM+
- Each resource in the pool must share the same security,
same as COM+
4. Fault Tolerance
- Load balancing is provided by many vendors
- Provided by home interface implementation
- Provided by registration of factories in the Java Naming
and Directory Interface (JNDI)
5. Ease of Development
- Allow bean producers to concentrate on writing business
logic
- Declarative attributes are provided to reduce the amount of
security or transaction code
- An EJB producer must implement the life cycle methods, much
of which can be generated by developer tools
6. Help With Deployment
- An EJB-JAR (Java ARchive) file is created containing the
bean, helper classes, other resources, and a deployment descriptor
Example:
Publication Database
Search Engine