Grails / GORM, Disable First-level Cache
- by Stephen Swensen
Suppose I have the following Domain class mapping to a legacy table, utilizing read-only second-level cache, and having a transient field:
class DomainObject {
static def transients = ['userId']
Long id
Long userId
static mapping = {
cache usage: 'read-only'
table 'SOME_TABLE'
}
}
I have a problem, references to DomainObject are being…