[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.rt.eclipselink] Re: use one connectio nper user - no connection pool
|
- From: Thomas Haskes <t.haskes@xxxxxxx>
- Date: Thu, 23 Jul 2009 08:36:06 +0200
- Newsgroups: eclipse.rt.eclipselink
- Organization: EclipseCorner
- User-agent: Thunderbird 2.0.0.22 (Windows/20090605)
Oh, I see. You mean setting the user and password properties at the
EntityManager like this:
HashMap map = new HashMap();
map.put(EntityManagerProperties.JDBC_USER, "John");
map.put(EntityManagerProperties.JDBC_USER, "pass");
emf.createEntityManager(map);
If you meant that. this didn't work. Unfortunately this Results in a
login using "" as username, which I consider a bug.
If did not mean that, sorry, then I couldn't follow you. Could you
provide me with a little snippet then? Sorry if I'm puzzled. Please set
me straight.
tbee schrieb:
> No. I mean "Em1" and "Em2", each having its own user set using the
> properties parameter in Java.
>
> Are you configuring the users in the persistence.xml?
>
> Tom
>
>
> Thomas Haskes wrote:
>> Thanks, i tried that already and it works, but since we are developing
>> an application that expects to have about 2000 users, this is simply not
>> an option.
>>
>> tbee schrieb:
>>> Hm. That is unexpected; appearantly some data is stored statically. That
>>> amazes me, since all configuration is done via instance level methods.
>>>
>>> How about configuring two identical EMFs? Each EMF has a name in the
>>> persistence.xml; create two identical ones.
>>>
>>>
>>>
>>> Thomas Haskes wrote:
>>>> Thanks for the fast answer. How can I force the method
>>>> Persistence.createEntityManagerFactory() to create a second connection
>>>> pool? According to the EL output the persistence.xml is read only once,
>>>> and so is the creation of the entitymanager. The first time i create an
>>>> EMF i see some output and the first time I create an EntityManager I
>>>> see
>>>> 7 logins from the first user (which is the default connection pool i
>>>> think), The second time I do all this I get a different EMF object and
>>>> EM object, but i see no output and no more logins from the second user.
>>>> Don't know why.
>>>>