Hi all,
I am trying to connect to two different apache derby schemas via jndi lookup. 
In order to do this I have created two datasources as follows (within 
tomee.xml):

<Resource id="jdbc/aName" type="DataSource">
JdbcDriver org.apache.derby.jdbc.ClientDriver
JdbcUrl jdbc:derby://database:1527/mui;create=false
UserName user_A
Password aPassword
</Resource>

<Resource id="jdbc/anotherName" type="DataSource">
JdbcDriver org.apache.derby.jdbc.ClientDriver
JdbcUrl jdbc:derby://database:1527/mui;create=false
UserName user_B
Password anotherPassword
</Resource>

In my application I have 2 separate ejb with two separate jpa configurations, 
one that looks-up for jdbc/aName another that looks up for jdbc/anotherName.
When I run my application the first jndi that accessed up is jdbc/anotherName 
and everything runs smoothly. When I try to access the second jndi I get an 
error telling me that the user has not access to the database.
In order to narrow down the problem, I have tried the following :
I have tried to access the two databases with the same credentials from ij 
(concurrently) and everything seems correct

I have tried to create two separate databases, instead of one database with two 
schemas, and everything runs fine within tomee

Could it be that I am missing some configuration and that the lookup fails to 
realize that I am using two different connections ?
I have tried to read the documentation regarding the JNDI configuration but I 
couldn't find where I am wrong.

Any help would greatly be appreciated
Marco F.

Reply via email to