I'm trying to save a large grails domain object structure, where the number of domain classes is a handful, but the number of objects around a hundred. The objects are linked using classic grails hasMany.
The basic idea is to wipe the database first and then populate it with a configuration DSL using a custom groovy builder. The builder returns a complete object graph/tree, which I then want to save.
I have tried various ways to save it, such as save just the root node, traverse the whole tree saving every node etc. However, Hibernate bails out at various places complaining about a flushed session.
Has anyone done something similar and can give some pointers/advice how to proceed?
Would it be better to integrate the save() operations as part of the build process, e.g. nodeCompleted(parent, node)?
Has Hibernate a maximum of the number of outstanding SQL operations, that has become exceeded?