Closed ahamid closed 11 years ago
@ahamid Good catch. I meant for the underlying tuples to not be frozen. It's fine if they are, but I don't want to make any assumptions about the object passed in.
I'll look at how freezing is used in Axiom::Relation
and see if I can be a bit less aggressive in freezing.
@dkubb Hah, we discussed this many times already. And I suggest you use Adamantium::Flat. I solved similar scenarios where "not my layers" data is reachable with "flat freezing".
@mbj yeah, that's what I was thinking about doing.
Another thing I need to do is add some specs to methods to ensure the arguments passed in to most of my methods are not frozen as a side effect. If we need to freeze something, we should (deep) dup it and then freeze the clone.
This was fixed in https://github.com/dkubb/axiom/pull/29
I am upgrading from Veritas to Axiom and noticed that my custom tuple enumerator is breaking now because of automatic object graph freezing that is now happening. Example that illustrates the problem:
if both changes enabled by
DONT_AUTO_FREEZE
andOVERRIDE_FREEZE_OBJECT
are not enabled, the following exception occurs:This is obviously a contrived example. See (sort of) real use case here:
https://github.com/ahamid/flatfiles/blob/master/lib/flatfiles/record_file_enumerator.rb https://github.com/ahamid/flatfiles/blob/master/lib/flatfiles/veritas/tuple_provider.rb#L71
Is there really an assumption that the tuple enumerator represents a static, frozen content? I am a bit confused by how Adamantium is configured but
Axiom::Relation
appears to be inheriting Adamantium functionality via its inclusion ofEqualizer
:https://github.com/dkubb/axiom/blob/master/lib/axiom/relation.rb#L8
(it appears that the module inclusion hook is called both for Equalizer and Relation)