Grails Bulk updates

if you have a bulk operation: delete or update you can set the flush so it will occur every 1000 records updated.

def commitEvery = 1000
Domain.list().eachWithIndex{ obj, index -> = value flush:0 == index % commitEvery
session = sessionFactory.getCurrentSession()

Leave a Reply

Your email address will not be published. Required fields are marked *