sadasivaiahgoli opened a new issue, #14408:
URL: https://github.com/apache/grails-core/issues/14408

   Iam  using grails 3.2.9 and  gorm mongo version 6.1.2.
   
   I am using descriminator mulitenant in my application.
   Iam using two database connection in my application.There are  syminvest1, 
syminvest2.I have authUser domain class, FinConfValues two domain classes. 
FinaConfValues has multitenantId.Here multitenant means authUserId.AuthUser 
collection is there in syminvest1,FinConfValues collection   is there in  
syminvest2.
   Steps to reproduces the error
   When I access FinConfValues.list() it is throwing the exception.
   No GORM implementation configured for type [class 
org.grails.datastore.mapping.mongo.MongoDatastore$2]. Ensure GORM has been 
initialized correctly. Stacktrace follows:
   The domain classes are
   
   AuthUser
   ```
   class AuthUser implements Serializable {
   
        private static final long serialVersionUID = 1
   
        transient springSecurityService
        ObjectId id
        String username
        String password
        String firstname
        String lastname
        String email
        String phoneno
        
        boolean enabled = true
        boolean accountExpired
        boolean accountLocked
        boolean passwordExpired
   
        AuthUser(String username, String password) {
                this()
                this.username = username
                this.password = password
        }
   
        Set<Role> getAuthorities() {
                AuthUserRole.findAllByAuthUser(this)*.role
        }
   
        def beforeInsert() {
                encodePassword()
        }
   
        def beforeUpdate() {
                if (isDirty('password')) {
                        encodePassword()
                }
        }
   
        protected void encodePassword() {
                password = springSecurityService?.passwordEncoder ? 
springSecurityService.encodePassword(password) : password
        }
   
        static transients = ['springSecurityService']
   
        static constraints = {
                username blank: false, unique: true
                password blank: false
        }
   
        static mapping = {
                password column: '`password`'
                  datasource 'syminvest1'
   
        }
   }
   ```
   
   FinConfValues
   ```
   class FinConfValues implements MultiTenant<FinConfValues> {
       ObjectId id
       ObjectId authUserId
       String symbol
       BigDecimal r
       BigDecimal g
       BigDecimal inflationRate
       Integer nYears
       Date reportingDate
       BigDecimal revGrowthRate
       static constraints = {
           symbol(nullable:true)
           r(nullable:true)
           g(nullable:true)
           inflationRate(nullable:true)
           nYears(nullable:true)
           reportingDate(nullable:true)
           revGrowthRate(nullable:true)
           authUserId(nullable:true)
       }
       static mapping = {
           tenantId name:'authUserId'
           collection 'finConfValues'
           datasource 'syminvest2'
       }
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to