Good news. I worked with Dirkjan on this issue, and we found the problem!
The reconnect flag was not being set properly. The fix is in github:
http://tinyurl.com/7sqj8g.

I am very happy to have this err behind me!

..tony..


On Tue, Jan 13, 2009 at 10:54 AM, Tony Mann <[email protected]> wrote:

> I now have a separate server set up where I can repro this problem at will.
> It does not happen when the server first starts, but if I wait a few
> minutes, the error appears, and page refreshing will not fix it.
> I have just started diving into the code, and here is the stack trace:
>
> /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.9/lib/dm-core/adapters/data_objects_adapter.rb:66:in
> `execute_reader'
> /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.9/lib/dm-core/adapters/data_objects_adapter.rb:66:in
> `read_one'
> /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.9/lib/dm-core/adapters/data_objects_adapter.rb:173:in
> `with_connection'
> /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.9/lib/dm-core/adapters/data_objects_adapter.rb:61:in
> `read_one'
> /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.9/lib/dm-core/repository.rb:72:in
> `read_one'
> /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.9/lib/dm-core/model.rb:263:in
> `first'
> /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.9/lib/dm-core/model.rb:273:in
> `first_or_create'
>
> The line of code that raises the exception is:
>
> def read_one(query)
>   with_connection do |connection|
>     command = connection.create_command(read_statement(query))
>     command.set_types(query.fields.map { |p| p.primitive })
>
>     begin
>       reader = command.execute_reader(*query.bind_values) # <<< This is
> where the exception is
>
>       if reader.next!
>         query.model.load(reader.values, query)
>       end
>     ensure
>       reader.close if reader
>     end
>   end
> end
>
> Now, I may be missing something, but the proper response to this error is
> to make a new connection and try again. Per the MySQL docs:
>
> If you have a script, you just have to issue the query again for the client
>> to do an automatic reconnection. This assumes that you have automatic
>> reconnection in the client enabled
>>
>
> So refreshing the page should work, and indeed it did work in DO 0.9.9.
> However, refreshing the page does not work in DO 0.9.10.1. This makes me
> wonder if the reconnection flag is really set. My next step is to determine
> how to test the flag, and also explore other reasons that reconnect might be
> failing.
>
> Also, it appears that DO is not resubmitting the query as it is supposed
> to. Am I missing something?
>
> ..tony..
>
>
> On Mon, Jan 12, 2009 at 11:31 PM, Dirkjan Bussink <[email protected]>wrote:
>
>>
>> On Tue, Jan 13, 2009 at 2:19 AM, Tony Mann <[email protected]> wrote:
>> > I just rolled back to DM 0.9.8 and DO 0.9.9 and the problem went away.
>> So if
>> > the problem is indeed a server configuration, it is the interaction of
>> that
>> > configuration and DM/DO that is causing the issue.
>> > I will see if I can get to the bottom of this...
>>
>> This is really, really weird. I've explicitly added stuff to the
>> latest DO that keeps the connection alive. It sets the client option
>> that it wants reconnections and also explicitly pings the server
>> before trying to do a query (which allows for reconnect with older
>> MySQL servers). Do you get the exception that says you should report
>> this issue to the Datamapper Lighthouse pages?
>>
>> Are you sure your server allows for reconnection? Otherwise the
>> changes might show the problem more prominent, just a guess though.
>>
>> --
>> Regards,
>>
>> Dirkjan Bussink
>>
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
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