Commit will automatically rollback the database transaction if the commit fails.
You could is not quite right though,
you should have a return or something after the rollback, otherwise you are trying to commit the transaction that was rolledback.
Normally the try/catch the commit is inside the try,
i.e.