Using Grails GORM Memory

I am wondering how grails handles memory usage and loading (fetching) domain objects using GORM methods, for example:

findAllWhere
findAllBy
list
...
  • Are they fully loaded (respectively, their proxies) in memory?
  • If I cross them with help each/every/any, are they supported by the iterator, loading them lazily?
  • Should I prefer createCriteria() {...}.scroll()for better memory usage?
+5
source share
1 answer

Assuming we ignore the different behavior of each type of DB driver used by GORM, we can find the answers in the code and documentation.

Dynamic crawlers are provided to domain org.grails.datastore.gorm.GormStaticApiclasses and search classes in a package org.grails.datastore.gorm.finders.

, , , , DetachedCriteria criteria.list(); , . Groovy , .

" ?" - , , lazy.

, , , , scroll ( , ).

GORM DB.

+1

All Articles