I am talking about a fix here, as things could have changed since the last time I worked seriously with JPA. However, JPA 2, in my opinion, is the current specification. I doubt that the jar you specified is a JPA 2 specification. In 2011, Geronimo did not support JPA 2 out of the box at this point.
Regarding EJB and JPA:
- Both EJB and JPA are based on POJO (plain old Java objects).
- JPA classes are essentially data access layer technology used to interact with your data layer.
- EJB is essentially used for the business layer. It will contain the business logic and organize the interaction between the various JPA classes. For example, in JPA you may have a customer class (which interacts with the customer table) and an order class (which interacts with the Orders table). In your EJB, you will use both of these classes to create a new order for a specific customer.
When using JPA as a technology, it allows you to maintain access to the database at the same level. This layer can be used by EJB, a web application (Servlets, JSP, JSF), web services, and even a swing application. This will support the database access logic in all of these applications. Then changes to the database will require changes to the JPA.
This is a very simplified explanation of the differences, and this subject is really deep, but these points should help you distinguish between them.
By the way, the new EJB specification really makes beans very easy to use, develop, and deploy. I am fortunate to have missed the original specification all these years ago. They are currently very easy to use.
Hope this helps clear the fog a bit.
source share