I’m having trouble with transactions with rails 3.0.3 and mysql 5. I’d
like to import data etl-batch-style:
class Job < ActiveRecord::Base
extract # some connection.execute / job.update_attribute stuff
transform # some connection.execute / job.update_attribute stuff
I’m using InnoDB as storage engine and transaction seem to be working
so far: If I start a job while being logged in before starting that
job, my session is isolated and I don’t see any data.
But: If the job fails (exeption) there is data in the database -
although a rollback is performed:
The rollback itself is logged “SQL (0.1ms) ROLLBACK” - and no COMMIT
Is rails perfoming a “ROLLBACKUP TO SAVEPOINT” instead?
How can I make sure, that no data is written, if a ROLLBACK happens?