It is strongly advised to configure the JPA component to use a specific
EntityManagerFactory instance. If failed to do so each
JpaEndpoint will auto create their own instance of
EntityManagerFactory which most often is not what you want.
For example, you can instantiate a JPA component that references the
myEMFactory entity manager factory, as follows:
<bean id="jpa" class="org.apache.camel.component.jpa.JpaComponent"> <property name="entityManagerFactory" ref="myEMFactory"/> </bean>
In Camel 2.3 the
JpaComponent will auto
EntityManagerFactory from the Registry which means you do not
need to configure this on the
JpaComponent as shown above. You only need to do
so if there is ambiguity, in which case Camel will log a WARN.