Does any one has idea about this thread that I have created at Gails
mailing-list ? :
http://grails.1312388.n4.nabble.com/Effect-of-Enabled-Hibernate-Level-2-cache-on-Domain-td3405253.html
Hi,
If I enable Hibernate Second Level Cache for my app. And put proper
eh-cache.xml. Lets say I have 3 domain classes.
1. Brand
2. User
3. BrandUserRole
class Brand {
....
static hasMany = [ brandUserRoles: BrandUserRole]
static mapping = { cache true }
...
}
class User {
.....
static hasMany = [ brandUserRoles:BrandUserRole]
.....
}
class BrandUserRole {
....
static belongsTo = [brand: Brand, user: User]
....
}
As you can see, only Brand has mapping for "cache true". Following
are my doubts (Sorry for so many ):
1. Does that mean that User and BrandUserRole and User will Never get
cached ?
2. Will dynamic methods like findAll etc. on Brand will automatically
start caching the results or I need to tell in the call to make that
as cacheable query ?
3. If Author and BrandUserRoles are still cacheable because of default
in datasource.groovy, I assume we have to set "cache false" explicitly
if I dont want to cache some domain as its getting updated too
frequently and it makes no sense to cache it.
Actually I am gonna try out with some sample code soon, but would be
great if I can get some rough idea before hand in the mean time. I
will surely update my blog
http://yagneshchawda.blogspot.com/ when I
am done with my testing on this
Actually ther are few more question related to this, but it all
depends what answers I find for above questions