Use autocommit() and clean up locks/cursors