I am seeing some weird behavior from datamapper. On some machines (all
with the same exact specs) this runs fine, and on others, well.. this
happens:

>> c = Category.create :name => "hello thar"
>> c.products.create :name => "this product is amazing"
>> Product.first
 ~ (0.000251) SELECT `id`, `name`, `slug`, `price`, `original_price`,
`weight`, `quantity`, `in_stock`, `created_at`, `updated_at`,
`image_file_name`, `image_content_type`, `image_file_size`,
`image_updated_at`, `category_id` FROM `products` ORDER BY `id` LIMIT
1
=> #<Product id=1 name="this product is amazing" description=<not
loaded> slug="this-product-is-amazing" price=nil original_price=nil
weight=nil quantity=0 in_stock=false created_at=#<DateTime:
70700628043/28800,-1/3,2299161> updated_at=#<DateTime:
70700628043/28800,-1/3,2299161> image_file_name=nil
image_content_type=nil image_file_size=nil image_updated_at=nil
category_id=1>


Cool. Everything looks great and then

>> Product.first.category
 ~ (0.003962) SELECT `id`, `name`, `slug`, `price`, `original_price`,
`weight`, `quantity`, `in_stock`, `created_at`, `updated_at`,
`image_file_name`, `image_content_type`, `image_file_size`,
`image_updated_at`, `category_id` FROM `products` ORDER BY `id` LIMIT
1
 ~ (0.000167) SELECT `id`, `name`, `slug` FROM `categories` ORDER BY
`id`
 ~ (0.000122) SELECT `id`, `name`, `slug` FROM `categories` ORDER BY
`id`
 ~ (0.000165) SELECT `id`, `name`, `slug` FROM `categories` ORDER BY
`id`
 ~ (0.000173) SELECT `id`, `name`, `slug` FROM `categories` ORDER BY
`id`
 ~ (0.000311) SELECT `id`, `name`, `slug` FROM `categories` ORDER BY
`id`

------ this goes on for awhile ------

 ~ (0.000261) SELECT `id`, `name`, `slug` FROM `categories` ORDER BY
`id`
 ~ QUERY INVALID: #<DataMapper::Query @repository=:default
@model=Category @fields=[#<Property:Category:id>,
#<Property:Category:name>, #<Property:Category:slug>] @links=[]
@conditions=[] @order=[#<DataMapper::Query::Direction
#<Property:Category:id> asc>] @limit=nil @offset=0 @reload=false
@unique=false> (stack level too deep)
 ~ stack level too deep
SystemStackError: stack level too deep
        from /home/jonuts/public_html/demo/gems/gems/dm-core-0.9.10/lib/dm-
core/model.rb:124:in `storage_name'
        from /home/jonuts/public_html/demo/gems/gems/dm-core-0.9.10/lib/dm-
core/adapters/data_objects_adapter.rb:376:in
`original_property_to_column_name'
        from /home/jonuts/public_html/demo/gems/gems/dm-aggregates-0.9.10/lib/
dm-aggregates/adapters/data_objects_adapter.rb:56:in
`property_to_column_name'
        from /home/jonuts/public_html/demo/gems/gems/dm-core-0.9.10/lib/dm-
core/adapters/data_objects_adapter.rb:316:in `order_column'
        from /home/jonuts/public_html/demo/gems/gems/dm-core-0.9.10/lib/dm-
core/adapters/data_objects_adapter.rb:302:in `order_statement'
        from /home/jonuts/public_html/demo/gems/gems/dm-core-0.9.10/lib/dm-
core/adapters/data_objects_adapter.rb:302:in `map'
        from /home/jonuts/public_html/demo/gems/gems/dm-core-0.9.10/lib/dm-
core/adapters/data_objects_adapter.rb:302:in `order_statement'
        from /home/jonuts/public_html/demo/gems/gems/dm-core-0.9.10/lib/dm-
core/adapters/data_objects_adapter.rb:237:in `read_statement'
        from /home/jonuts/public_html/demo/gems/gems/dm-core-0.9.10/lib/dm-
core/adapters/data_objects_adapter.rb:41:in `read_many'
        from /home/jonuts/public_html/demo/gems/gems/dm-core-0.9.10/lib/dm-
core/adapters/data_objects_adapter.rb:173:in `with_connection'
        from /home/jonuts/public_html/demo/gems/gems/dm-core-0.9.10/lib/dm-
core/adapters/data_objects_adapter.rb:40:in `read_many'
        from /home/jonuts/public_html/demo/gems/gems/extlib-0.9.10/lib/extlib/
lazy_array.rb:415:in `[]'
        from /home/jonuts/public_html/demo/gems/gems/extlib-0.9.10/lib/extlib/
lazy_array.rb:415:in `lazy_load'
        from /home/jonuts/public_html/demo/gems/gems/extlib-0.9.10/lib/extlib/
lazy_array.rb:100:in `any?'
        from /home/jonuts/public_html/demo/gems/gems/extlib-0.9.10/lib/extlib/
lazy_array.rb:94:in `empty?'
        from /home/jonuts/public_html/demo/gems/gems/dm-core-0.9.10/lib/dm-
core/associations/relationship.rb:156:in `get_parent'
... 4463 levels...
        from /home/jonuts/public_html/demo/gems/gems/dm-core-0.9.10/lib/dm-
core/associations/many_to_one.rb:98:in `parent'
        from /home/jonuts/public_html/demo/gems/gems/dm-core-0.9.10/lib/dm-
core/associations/many_to_one.rb:84:in `instance_variable_get'
        from /home/jonuts/public_html/demo/gems/gems/dm-core-0.9.10/lib/dm-
core/associations/relationship.rb:161:in `get_parent'
        from /home/jonuts/public_html/demo/gems/gems/dm-core-0.9.10/lib/dm-
core/associations/relationship.rb:174:in `with_repository'
        from /home/jonuts/public_html/demo/gems/gems/dm-core-0.9.10/lib/dm-
core/support/kernel.rb:6:in `repository'
        from /home/jonuts/public_html/demo/gems/gems/dm-core-0.9.10/lib/dm-
core.rb:181:in `repository'
        from /home/jonuts/public_html/demo/gems/gems/dm-core-0.9.10/lib/dm-
core/repository.rb:44:in `scope'
        from /home/jonuts/public_html/demo/gems/gems/dm-core-0.9.10/lib/dm-
core.rb:181:in `repository'
        from /home/jonuts/public_html/demo/gems/gems/dm-core-0.9.10/lib/dm-
core/support/kernel.rb:6:in `repository'
        from /home/jonuts/public_html/demo/gems/gems/dm-core-0.9.10/lib/dm-
core/associations/relationship.rb:174:in `with_repository'
        from /home/jonuts/public_html/demo/gems/gems/dm-core-0.9.10/lib/dm-
core/associations/relationship.rb:137:in `get_parent'
        from /home/jonuts/public_html/demo/gems/gems/dm-core-0.9.10/lib/dm-
core/associations/many_to_one.rb:98:in `parent'
        from /home/jonuts/public_html/demo/gems/gems/dm-core-0.9.10/lib/dm-
core/associations/many_to_one.rb:102:in `method_missing'
        from /home/jonuts/public_html/demo/gems/gems/dm-core-0.9.10/lib/dm-
core/associations/many_to_one.rb:17:in `category'
        from (irb):4
        from :0>


I have seen this same thing happen on two separate projects where it
works on some machines all the time, and breaks on other machines
(again, all with the exact same specs) all the time. Tried pretty much
every combo using different versions of dm-core, data_objects,
databases, adapters, etc.

Anyone have any ideas?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DataMapper" 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/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to