Added autocommit mechanism. It would require some testing.