Please refer to my other blog titled “Configuring Multiple datasources in Grails” to know how to configure multiple datasources in Grails application. Now here I am writing about how to make finders work with multiple datasources in Grails. Lets say there is a domain called User which looks like :

class User {
    String username
    String password
    boolean enabled
    boolean accountExpired
    boolean accountLocked
    static mapping = {
        datasource 'ALL'
    }

Note : On line number 8 we mapped User domain with all datasources. Now we can find the user’s data from all datasources by Querying like:

 def userClass = User.class
 User user = userClass.master.findByName('amit')
    //Note : userclass.datasourceName.finder

Hope this help some one..