You need to use a
transaction to perform multiple DB
queries. The advantage is that if one of the query fails in the execution,
all of the previous that were executed get undone in the database. That way
you don't have any corrupted or incomplete data in your DB.