Ensure that the transaction is active before use Fixes #31

Fixes #31 Ensure that the transaction is active before use