ActiveRecord error: SAVEPOINT active_record_1 does not exist

To solve this issue..

config.use_transactional_fixtures = false


You are using Mysql DDE statements (create/drop/truncate table) which will result in an implicit commit.

Because of the implicit commit, all savepoints of the current transaction are deleted (Refer to above documentation).

To get around this, you can turn off transactions and use DatabaseCleaner (truncation mode).


You can use "TEMPORARY" when you create/drop tables.

http://dev.mysql.com/doc/refman/5.1/en/implicit-commit.html ALTER TABLE, CREATE TABLE, and DROP TABLE do not commit a transaction if the TEMPORARY keyword is used. (This does not apply to other operations on temporary tables such as CREATE INDEX, which do cause a commit.) However, although no implicit commit occurs, neither can the statement be rolled back. Therefore, use of such statements will violate transaction atomicity: For example, if you use CREATE TEMPORARY TABLE and then roll back the transaction, the table remains in existence.