When you create the persistence broker, you specify which repository to use:

PersistenceBrokerFactory.createPersistenceBroker( new
PBKey("repository2.xml"));

The connection descriptors are specified as before:

repository.xml:
----------------------------------------------------------
<!ENTITY repository_user_1 SYSTEM "repository_user_1.xml">
<!ENTITY repository_user_2 SYSTEM "repository_user_2.xml">
<descriptor-repository>
    <jdbc-connection-descriptor>...</jdbc-connection-descriptor>
    &repository_user_1;
    &repository_user_2;
    ...
</descriptor-repository>

repository2.xml:
----------------------------------------------------------
<!ENTITY repository_user_1 SYSTEM "repository_user_1.xml">
<!ENTITY repository_user_2 SYSTEM "repository_user_2.xml">
<descriptor-repository>
    <jdbc-connection-descriptor>...</jdbc-connection-descriptor>
    &repository_user_2;
    ...
</descriptor-repository>

Corey

-----Original Message-----
From: Richard Bowers [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 19, 2002 7:44 AM
To: OJB Users List
Subject: Re: Multiple repositories


Corey Klaasmeyer wrote:

>I have experienced exactly the same problem. The solution is to use entity
>references in repository.xml to make both repositories known to the default
>repository:
>
><!ENTITY repository_user_1 SYSTEM "repository_user_1.xml">
><!ENTITY repository_user_2 SYSTEM "repository_user_2.xml">
><descriptor-repository>
>    ...
>    &repository_user_1;
>    &repository_user_2;
>    ...
></descriptor-repository>
>
>Corey
>


Thanks Corey, but where do you specify the two different 
jdbc-connection-descriptor blocks? Looking at the repository.xml file in 
the test case, this block is in the main repository.xml file and the 
repository_user.xml file(s) contain only class descriptors. Does the 
"schema" attribute of class-descriptor allow the database to be specified?


Richard.



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to