You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm in using Paper Trail in Rails / ActiveRecord 3.1.15 under JRuby in the Torquebox server. I haven't had any issues until I started load testing. Now, every now and then I see the following error:
This is running inside a transaction, when a model is being created, in an after_save callback. All I can imagine is that ActiveSupport's class_attribute is somehow not thread-safe.
Any ideas? Thanks!
The text was updated successfully, but these errors were encountered:
I've never felt strongly about the need for using class_attribute for a lot of the fields that it is applied to via the has_paper_trail declaration, but can't speak to whether it's thread-safe or not. The one nice thing about class_attribute is that it can be overridden by instances of a class, but somehow I doubt that users really use that functionality. Do we think that cattr_accessor is more thread-safe for some reason? Or perhaps they should just be defined using attr_accessor? I don't have much experience with JRuby.
Anything in core Ruby should be thread-safe these days, whether MRI or JRuby. I can't figure out either what is unsafe about class_attribute, but if it's possible to use core Ruby methods that might be a good idea.
I'm in using Paper Trail in Rails / ActiveRecord 3.1.15 under JRuby in the Torquebox server. I haven't had any issues until I started load testing. Now, every now and then I see the following error:
This is running inside a transaction, when a model is being created, in an
after_save
callback. All I can imagine is that ActiveSupport'sclass_attribute
is somehow not thread-safe.Any ideas? Thanks!
The text was updated successfully, but these errors were encountered: