An application can enforce the all-or-nothing property, but it is much simpler for the database to enforce it. The database will enforce the all-or-nothing property if the database has the information that the statements constitute a transaction. Then, if one of the statements fails, the database aborts the transaction and returns any database that was affected to the state it would have been in if the transaction had not been submitted.