Accessing Multiple Databases
Enterprise Objects Framework applications access multiple databases almost transparently. Simply make different models for each database, and then you can create relationships from an entity in one database to an entity in another. In your application, you can fetch enterprise objects from different databases into the same object graph without any extra work. See the chapter "Using EOModeler" for more information.
Although a coordinator manages objects from multiple repositories, it doesn't guarantee consistent updates when saving changes across object stores. If your application requires guaranteed distributed transactions, you can either provide your own solution by creating a subclass of EOObjectStoreCoordinator that integrates with a TP monitor, use a database server with built-in distributed transaction support, or design your application to write to only one object store per save operation (though it may read from multiple object stores). For more discussion of this subject, see the EOObjectStoreCoordinator class specification in the Enterprise Objects Framework Reference.
Figure 45. Sharing EODatabaseContexts
The simplest way to prevent rendezvousing is to assign distinct connection dictionaries to your model files. You don't have to assign complete connection dictionaries. The dictionaries associated with different databases simply must differ in one or more entries.
Alternatively, you can programmatically assign complete connection dictionaries to your models before any EODatabaseDataSource objects are created-at application initialization time, for example. The best way to access your models is through the default EOModelGroup. The models method returns an array of all the EOModels used by the application.
Table of Contents Next Section