Transactional task implementation for python and fixes to rollback