Enterprise Objects makes it easy to work with multiple data stores in a single application. An application often includes enterprise object instances that represent data from different repositories.
The EOObjectStoreCoordinator is the object that manages multiple repositories in a single application. When a fetch is performed, it determines which repository can service the fetch. Similarly, when changes are committed, it determines which repository to save the changes to. When a fault is fired, it determines which repository can service the fault. And, Enterprise Objects is smart enough to generate database-specific or database-optimized SQL expressions within a single application that connects to multiple repositories.
There are, however, a few limitations when using multiple data sources in an application. They include:
Within an EOModelGroup, all entity names must be unique.
You can’t model inheritance hierarchies across different data sources.
You can’t flatten attributes or relationships across data sources.
Enterprise Objects doesn’t support two-phase commit, so you have to be careful when a saving enterprise objects that are constituted from different data sources in a single invocation of EOEditingContext.saveChanges().
If you understand these limitations, connecting to multiple data stores in an Enterprise Objects application should just work.
Last updated: 2007-07-11