On Tuesday, October 23, 2012 6:54:16 PM UTC-7, GregD wrote: > It looks like after the insert the key returned is not found in a followup > select. It is trying to do a select on id 1. The table is still empty > for some reason. > > et = Tournament.first > TournamentConfiguration.create(:tournament => et) > > > (0.031481s) SELECT * FROM `tournaments` LIMIT 1 > (0.000198s) SELECT sqlite_version() LIMIT 1 > (0.000074s) BEGIN > (0.001818s) INSERT INTO `tournament_configurations` (`tournament_id`) > VALUES (1) > (0.000181s) SELECT * FROM `tournament_configurations` WHERE (`id` = 1) > LIMIT 1 > (0.000409s) ROLLBACK >
See that ROLLBACK? For some reason, the transaction is rolling back and not committing. So naturally nothing is persisted in that case. You'll need to find out what is causing that ROLLBACK. Normal inserts don't cause that. Since it occurs after the SELECT * query, it isn't even occuring in an after_save or similar hook. The only thing I can think of that would cause what you are seeing without an exception being raised is if the transaction is being manually rolled back via a surrounding transaction(:rollback=>true), raising Sequel::Rollback after save returns, or manually swallowing the exception. > It looks like something in the environment. It looks like the last time I > had it working Sequel was at 3.23. I tried going back, but > talentbox-sequel-rails would also need to be rolled back to an older > version and then I'm sure this will cascade to other gems. Worse comes to > worse, I could roll those attributes up to the parent record. I had the > configuration in a separate one_to_one record so I could marshall the > configuration data in and out of a text field as a ruby object. This way I > have that data in a simple Sequel object. I tried commenting out all the > marshalling and just kept the Sequel association stuff and it still did not > work. That is when I emailed the group. > > Would the Gemfile help? Could it be something in the rails config dir > that may have changed. It really looks like the record is never really > inserted. > > Other than looking for the cause of the ROLLBACK, the only thing I can think of that would help is if you could put together a self-contained example showing the problem. If you can run your code without talentbox-sequel-rails, you may want to try that just to rule that out as a possible issue. Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/sequel-talk/-/AhOb7IWoNJcJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en.
