Looks a bit weird? Maybe something like this is better (only nitpicking though):

```
try { 
  f(this) 
} catch {
  case e: Throwable =>  //or Exception
    doRollback = true
    hasTransactionFailed = true
    ensureAsyncTransactionIsCompleted()
}
```