handle autocommit on close database