Mark, I was under the impression that what Aravind meant by 'Lazy loading' was the bringing of entities to the controller layer and fetching data from there. As far the association goes, I agree with you that we can't have two ends of an association placed in two different databases. Aravind, could you clarify if this is what you want?
Aravind Bhat wrote:What I need is a single service which connects to multiple data sources using separate transaction managers and to manage the transactions between them.
Aravind, I am not clear on something. Do you want multiple dbs to be part of the same transaction?
If yes, you don't need multiple transaction mangers. You need one JtaTransactionManager.
if No, you can use the same code I pasted in my post above and change the AOP settings to apply to the same service and specify which methods you want specific transaction managers to act on. But if you have a single method which accesses two different dbs under two transactional contexts, I suggest you separate these methods such that there is only one transactional context per method.