Strange that it worked with MyISAM tables without the commit, and not with InnoDB tables.
Isn't that because MyISAM tables are non-transactional (i.e they do not support commit, rollback), while InnoDB are transactional? See this (dev.mysql.com) article.