3.9.1.1. Standalone Deployment
The JPA Overview describes the jakarta.persistence.Persistence class.
You can use Persistence to obtain EntityManagerFactory instances, as demonstrated in Persistence.
OpenJPA also extends Persistence to add additional EntityManagerFactory creation methods.
The org.apache.openjpa.persistence.OpenJPAPersistence class
Javadoc details these extensions.
After obtaining the factory, you can cache it for all EntityManager creation duties.
OpenJPA factories support being bound to JNDI as well.