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.

On 10/1/07, Janap <[EMAIL PROTECTED]> wrote:
>
>
> Hello all,
>
> I need some information regarding use of Open JPA in Non-EE use. As I
> understood in the Open JPA manual, i am required to initialize
> EntityManagerFactory when the application(Tomcat) starts and use this to
> create the EntityManager.
>
> In our project this would be impossible since I have user-per-connection
> architecture, which means that i have the connection username and password
> beforehand. All authentication takes place after user logs in(no
> connection
> pooling!)
>
> can someone plz suggest how to use OpenJPA in this context??
>
> thx in advance
> Janap
> --
> View this message in context:
> http://www.nabble.com/EntityManagerFactory-configure-tf4547543.html#a12976940
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>
>

Reply via email to