The call_after_commit_callback() function (part of the after_commit
plugin) discards exceptions. I'm not sure if this is a limitation
with the way that the callbacks are implemented, but you can see the
stack trace if you wrap it in an exception:
# File: thinking-sphinx/vendor/after_commit/lib/after_commit/
active_record.rb
def call_after_commit_callback(call)
if can_call_after_commit call
begin
callback call
rescue Exception => ex
STDERR.puts "#{ex.message}\n#{ex.backtrace.join("\n")}
end
clear_after_commit_call call
end
end
I had a similar issue and the exception being thrown was b/c the
'last_error' and 'locked_at' columns in the delayed_jobs table had the
"NOT NULL" constraint on them. When the Job.create() function is
called, the code doesn't explicitly set these fields, so it fails --
and no Exception was thrown. I don't know exactly what these columns
are supposed to do, but I assumed that it was safe to be NULL since
the DJ code doesn't set a value for them.
Here is my DJ table in MySQL. This is a slight modification to
something I found posted on this forum, or on the website somewhere:
CREATE TABLE delayed_jobs (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
priority INT UNSIGNED NOT NULL DEFAULT 0,
attempts INT UNSIGNED NOT NULL DEFAULT 0,
handler VARCHAR(128) NOT NULL,
last_error VARCHAR(32) DEFAULT NULL,
run_at DATETIME DEFAULT NULL,
locked_at DATETIME DEFAULT NULL,
failed_at DATETIME DEFAULT NULL,
locked_by VARCHAR(32) DEFAULT NULL,
created_at DATETIME DEFAULT NULL,
updated_at DATETIME DEFAULT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB;
[OT] Until I changed the MySQL script, my application worked on some
machines but not others. I still don't quite understand how
ActiveRecord sets default values, and how they relate to the
underlying databases defaults settings.
In any case, I hope this helps -Chris
On Jul 17, 4:52 pm, gbright <[email protected]> wrote:
> Hello,
>
> I have been having a similar problem. Using Rails 2.1.0, ts version
> 1.1.22 plugin, etc. Whenever a new record is being saved, nothing is
> being inserted into the delayed_jobs table, hence delta indexing is
> not working. I don't have any other versions of the model lying
> around. Can anyone provide me with some hints as to where I might be
> able to place debugging statements to determine whether or not the
> callbacks are firing properly?
>
> Thanks.
>
> Greg
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
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/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---