Reputation: 13509
I'm a happy Tomcat user, and wish to use the new Java Persistence API. I'm a little confused as to where I should get it from?
I don't find the official documentation regarding my questions very clear.
The reason I ask is because I don't want to deploy very large files. If the container I'm using supports / contains a JPA API, then I'd rather not deploy one with every application?
I had this idea in my head that Tomcat 7's JAR's may have it?
Upvotes: 0
Views: 322
Reputation: 7491
You can definitely use JPA in Tomcat. Currently we are using OPENJPA in Tomcat adding JPA enhancer to the build. There are also a lot of examples (i.e. http://dev.imanol.me/post/32735636704/tomcat-jpa-hibernate-and-mysql) for setting up Hibernate JPA in Tomcat.
Upvotes: 0
Reputation: 403441
Is Java EE 6 something specific to an EJB container, such as JBoss or Glassfish?
Java EE 6 is a specification. It's agnostic as to how that spec is implemented, but generally this is done by an appserver such as the two you mention.
Does this mean that if you have an EE 6 container, it automatically supports JPA?
Yes. JPA is part of JavaEE v5 and v6.
Is JPA a specification, or an API?
Both. The spec defines the semantics, the API defines the syntax.
Are Hibernate, Kodo or OpenJPA, DataNucleus, EclipseLink, TopLink all implementation of the JPA specification?
Yes. Different appservers ship with different JPA implementations.
If the container I'm using supports / contains a JPA API, then I'd rather not deploy one with every application?
That's the general idea. Use the services that your appserver provides.
I had this idea in my head that Tomcat 7's JAR's may have it?
I'm not familiar with v7 specifically, but Tomcat isn't a full JavaEE implementation (it provides JSP, servlets, and a couple of other things like JNDI), but not JPA. If you deploy to Tomcat, your application will need to package its own JPA implementation.
Upvotes: 3