Some non-transactional changed tables couldn't be rolled back
Posted on Sat Mar 04 15:36:00 UTC 2006
Here’s an other thing that is not supposed to happen, but invariably does.
Playing aroung with Unit Testing in Rails (you are using them, right?), one test fails with:
Exception `ActiveRecord::StatementInvalid’ at
…/active_record/connection_adapters/mysql_adapter.rb:185
- Mysql::Error: Warning: Some non-transactional changed
tables couldn’t be rolled back: ROLLBACK
Turns out that on my OS (debian), the default mysql database table type is MyISAM and it does not support ROLLBACK, try InnoDB instead.
March 12, 2006 update:
In case this is not possible, or too much problem, there is an other solution (albeit slower).
In test/test_helper.rb, change:
self.use_transactional_fixtures = true
to
self.use_transactional_fixtures = false
this way, the testing framework won’t use rollback but drop and recreate the tables each time (which explains why this is slower).

There are no comments yet... Be the first to voice your opinion!