I had a comment on my blog yesterday about ORM’s restrictions on multiple datasources. Yes, ORM in ColdFusion 9 is restricted to one datasource per application. However this does not mean you are restricted to one database, schema or tablespace.
A datasource is just an abstraction for database connection details. It takes a server, a port, user credentials, a default database and other information. On the database side, just because a database is defaulted doesn’t mean that you are limited to just that database. In SQL you can append schema namespaces to the front of a table:
This can also be accomplished in ORM components by specifying the schema attribute on the component. This will allow you to access a table outside the default database.
So if you have the need to access multiple databases/tablespaces/schema on one database server you absolutely can with the proper credentials and the schema attribute.