Use inTransaction to check if an active transaction exists or not