If you want to do proper error handling, instead of doing rollback, itseems better to first do anything that can fail (allocations), then dothe actual attaching, which cannot fail. It isn't nice to havetransient states on failure.