multi-tenant with multiple datasources?



I'm trying to figure out if it's possible to implement a multi-tenant service by having multiple datasources and redirecting actions based on login information.

I'm building on top of the tutorial found in

My idea was to create 3 datasources instead of just 1. Identical A and B datasources for projects and tasks and a separate "users" datasouce for the users.

Is this idea feasible? (I'm a beginner in Grails) or are there better ways to do it - I know there is the single-db plugin, but I'd need to have the client data to reside in separate databases, so I'm not using it.

I already managed to get projects listing from "B" by having project model map to both databases and using project.B.list instead of project.list in the controller (hard coded) but mapping user model to user database now somehow breaks the application.