Implements the 'limit' parameter
Correctly rolls back insertion if something fails