Again, the reasoning here is that a var is not thread safe unless carefully managed.
But then again, I didn't look at the whole picture. I think I was wrong in thinking that volatile would help here so please ignore that comment. Sorry about that :/

I guess the question is: is it possible to call  withAsyncTransaction 2 times on the same SessionWithAsyncTransaction, one right after the other? To me it looks like that means there would be 2 async session going on at the same time? 


Either way, could you at least make the `hasTransactionFailed` field private (and rather add a getter if you want people to access it)?
The reason is simply that I am generally worried about mutable state, because it makes my head hurt.