Thx for the replies. So as I understand , I can create EntityManagerFactory
when my server starts by giving it a persistence unit name and WITHOUT
giving it a username and password which are neccessary to make a DB
connection?

For every user who logs in , i can create an EntityManager by passing the
connection parameters in the map. This EntityManager, I can either keep it
in session per user or create everytime a transaction is needed.

I will now start making an example and let you know what has happened!

Janap



Alessandro Ferrucci-3 wrote:
> 
> There is no obligatory contract between the EntityManagerFactory and
> whatever container/environment you are in.  The EntityManagerFactory
> is...just that..a factory of EntityManagers.  Read:
> http://openjpa.apache.org/docs/latest/manual/manual.html#jpa_overview_emfactory_obtainto
> see how to retrieve an EntityManager, you must pass in a Map of
> attributes that your EntityManager will be configured with to talk to the
> DB
> 
> 
> mainly:
> 
>    -
> 
>    openjpa.ConnectionUserName
>    -
> 
>    openjpa.ConnectionPassword
>    -
> 
>    openjpa.ConnectionRetainMode
>    -
> 
>    openjpa.TransactionMode
>    -
> 
>    openjpa.<property>, where *<property> * is any JavaBean property of
>    the 
> org.apache.openjpa.persistence.OpenJPAEntityManager<http://openjpa.apache.org/docs/latest/javadoc/org/apache/openjpa/persistence/OpenJPAEntityManager.html>.
> 
> 
> Also of importance is this:
> 
> http://openjpa.apache.org/docs/latest/manual/manual.html#jpa_overview_persistence_xml
> 
> this tells you how to configure a certain factory in non-EE settings.
> 
> 
> HTH
> 
> Alessandro Ferrucci.
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/EntityManagerFactory-configure-tf4547543.html#a12977957
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to