Thanks for the response. Upon reading through what you've provided I realized that maybe I didn't ask the right question. Let me see if I can explain it a little better.
We have a library that utilizes both PersistenceBroker and ODMG that abstracts a lot of the OJB functionality for our objects. We use this library in a couple of different applications. One of these applications is a security management component that I have now been charged with integrating into another application. We currently have two completely separate repository.xml definitions for the two applications. We would prefer to keep the two separate for maintenance reasons. So, what I'm hoping is that there is some way that I can make use of the two xml files with as little merging as possible.
Any thoughts?
Dave
Armin Waibel wrote:
Hi David,
----- Original Message ----- From: "David C. Hicks" <[EMAIL PROTECTED]> To: "OJB" <[EMAIL PROTECTED]> Sent: Tuesday, June 10, 2003 8:54 PM Subject: Multiple Databases in one repository.xml?
From reading through the OJB documentation on repository.xml, I getthe
impression that it is possible to have connection pools to twodifferent
data sources in the same application, however I don't see any way tomap
which objects are persisted in which data source.
Say you have defined two different jdbc-connection-descriptor using different datasources with jcd-alias names 'db_1' and 'db_2'. PBKey key1 = new PBKey("db_1", "user1", "passwd1"); PBKey key2 = new PBKey("db_2", "user2", "passwd2");
PersistenceBroker broker_1 = PBF.createPersistenceBroker(key1); PersistenceBroker broker_2 = PBF.createPersistenceBroker(key2);
Or is the problem that you get an object of type XY and you want automatic decide which datasource/broker is to use? If so you can use custom-attributes in class-descriptor tag (of the persistent object metadata): <attribute attribute-name="datasource" attribute-value="db_1"/>
read with classdescriptor.getAttribute("datasource")
To get the ClassDescriptor of the given object you can use MetadataManager.
regards, Armin
Has anyone ever triedpersistence,
this? I actually do have a need to do this as I have a component that
utilizes OJB for persistence that will be embedded in several
applications. One of these applications also uses OJB for
but all applications need to share a common database for my component.
Thanks in advance for any input, Dave
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
