I dont want the row to be created in the DB if there is any error even
after the save. So what should be done??
The below is the log:
SQL (0.001000) INSERT INTO projects ('name', 'user_id')
VALUES('test', 10)
app/models/project.rb:305:in `confirm_project'
app/models/project.rb:288:in `confirm_project'
app/models/project.rb:274:in `confirm_project'
app/controllers/test_controller.rb:19:in `confirm_project'
app/controllers/test_controller.rb:12:in `select_user'
SQL (0.000000) ROLLBACK
That's normal. Were you expecting to see DELETE FROM projects ... ?
But a roll back should come to the previous state. so in this case how i
can get back to the previous state with out inserting into DB..
What should I do??
But a roll back should come to the previous state. so in this case
how i
can get back to the previous state with out inserting into DB..
What should I do??
The ROLLBACK statement magically unwinds all changes made. The
database (ie not your app or activerecord) takes care of that.
Hi,
Thanks a lot. Now its working fine. Right now my table type is MyISAM
and I changed the type into InnoDB Storage. In this type the
transactions are safe.
Now all the transactions are getting rolled back.
Hi,
Thanks a lot. Now its working fine. Right now my table type is MyISAM
and I changed the type into InnoDB Storage. In this type the
transactions are safe.
Now all the transactions are getting rolled back.
Ah yes. As you have found out, myisam doesn't do transactions at all