No I do not want to do this. Because in this case I will end up creating an
EntityManagerFactory for every user. According to JPA Manual creating an 
EntityManagerFactory is an expensive process.

I want only one Factory for all the users of my application.

Janap

Ognjen Blagojevic wrote:
> 
> Hello Janap,
> 
> Maybe you can try comething like this:
> 
> public static EntityManagerFactory createEntityManagerFactory(String 
> persistenceUnitName, Map properties)
> 
> "    Create and return an EntityManagerFactory for the named persistence 
> unit using the given properties."
> 
> Put username, password and other things in the map.
> 
> Regards,
> Ognjen
> 
> 
> 
> Janap 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 dont 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#a12978170
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to