Using the latest version of NHibernate (and possibly some plugins), is that possible to map entities across multiple databases on different servers without DB link?
For the background, I'm looking to implement something loosely similar to what is described in this DBA.SE post.
I've got an interesting answer on the nhusers mailing list. Excerpt follows:
From Jason Meckley
[...] if you are talking about storing a single entity across multiple databases, the answer is not cleanly. you might be able to do something with custom user types and/or event listeners to hydrate the object, but that would be a mess to maintain.
A different approach is to transfer the data from one db to another using an ETL process. similar to replication, but only transferring the data required by the other database. you end up with 1 writable database and many read databases. then you map the domain to a single database.
Another option is to determine why there are multiple databases. if they represent different types of data/objects then explicitly express this in the domain. for example CustomerWithAddress is a different entity than CustomerOrder. If you need information from both, then query each database individually and build up a projection in code.
var x = session1.get(id);
var y = session2.get(id);
return merge(x, y);