I cannot directly see anything wrong in the example, but what you described would mean that the currentApplication instance is not set. This happens, for example, if you haven’t registered your application as a transaction listener and thus transactionStart is never called.