Server side development platform
  • EJB, Enterprise Java Bean,  is a component based java application.
  • Allowing to create reusable and editable components for many end-point applications, over the existing source code
  • Once created and compiled, can be deployed to a compatible server for extended usage.
  •  EJB tender the components which are automatically mapped to the underlying vendor-specific infrastructure or services.
  • EJB has three flavors: Entity, Session and Message driven
    • Entity : State is SHARED, TRANSACTIONAL
      • a single point of access for data -- any client will access the data through the entity bean
    • Session: Sate is Private and Conversational
      • The data is cached in the application variables, volatile, only accessible to designated single client.
      • Multiple clients will require multiple session bean
      • Closed with the end of application cycle.
      • @Stateless annotation: Every stateless session bean implementation must be annotated using the annotation @Stateless or marked that way in the ejb-jar.xml file.
Java Persistence API: http://www.oracle.com/technetwork/java/javaee/tech/persistence-jsp-140049.html 

Java Persistence API

The Java Persistence API provides a POJO persistence model for object-relational mapping. The Java Persistence API was developed by the EJB 3.0 software expert group as part of JSR 220, but its use is not limited to EJB software components. It can also be used directly by web applications and application clients, and even outside the Java EE platform, for example, in Java SE application


 Java community has produced numerous object-oriented approaches to data persistence: EJB, JDO, Hibernate, and Toplink are all worthy solutions that have tackled this problem. The Java Persistence API, or JPA, is a standard persistence API introduced as part of the Java EE 5 platform. The JPA specification was first introduced as part of JSR 220: EJB 3.0, with the goal of simplifying the EJB entity beans programming model. Although it all started with entity beans and is packaged with Java EE 5.0, JPA can be used outside the container in a Java SE environment.

"The result is a standardized specification that helps you build a persistence layer that is independent of any particular persistence provider."