Your first code does not raise an exception and so the transaction is not rolled back. Note the exclamation mark after create!
Your first code does not raise an exception and so the transaction is not rolled back. Note the exclamation mark after create!