Announcement Announcement Module
Collapse
No announcement yet.
withTransaction in a collection Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • withTransaction in a collection

    Stuck on something...if I have a collection foo and I loop through that collection to do updates on each record in the loop, how do I make it so that each record in the collection is in it's own transaction? The goal is if record 1 in the collection fails on a save that record 2 will still be processed.

    Would I use a withTransaction?

    something like this

    foo.each { line ->

    foo.withTranaction{

    }

    }
Working...
X