Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

There was a problem

You must be a member of this account.

ronin-37814 (at lighthouseapp)'s latest activity

Thursday, February 26 2009
1752 Adding cleanup_connection method was updated in Ruby on Rails
  • ronin-37814 (at lighthouseapp)
    ronin-37814 (at lighthouseapp) commented at 4:08 PM

    Yes, the issue you pointed out is exactly why I created this ticket.

    We need more than what your implementation of with_connection provides. If you have nested ...

Thursday, February 19 2009
1752 Adding cleanup_connection method was updated in Ruby on Rails
  • ronin-37814 (at lighthouseapp)
    ronin-37814 (at lighthouseapp) commented at 7:10 PM

    Well there are two versions...

    In the original version (cleanup_connection method), if a connection is already checked out it won't check out a new one. But wil...

Wednesday, February 18 2009
1752 Adding cleanup_connection method was updated in Ruby on Rails
  • ronin-37814 (at lighthouseapp)
    ronin-37814 (at lighthouseapp) commented at 8:55 PM

    with_connection isn't good enough. It only releases the connection which it checks out. And the connection it checks out will be different from AR::B#connection

Tuesday, February 17 2009
1752 Adding cleanup_connection method was updated in Ruby on Rails
  • ronin-37814 (at lighthouseapp)
    ronin-37814 (at lighthouseapp) commented at 11:02 PM

    Hey nick

    The only issue with that is that if you have multiple connections (in different AR models) you'd need to do a connection call for each of them. If you ...

  • ronin-37814 (at lighthouseapp)
    ronin-37814 (at lighthouseapp) commented at 10:25 PM

    As requested by lifo

    Real World Usecase:

    You have 100 threads which stay alive and running throughout the entire life of your process. These threads are intermi...

  • ronin-37814 (at lighthouseapp)
    ronin-37814 (at lighthouseapp) commented at 9:31 PM

    Moved cleanup_connection method to ConnectionHandler. Using clear_active_connections! instead of release_connection so we release connections from all connectio...

Wednesday, January 14 2009
1752 Adding cleanup_connection method was updated in Ruby on Rails
  • ronin-37814 (at lighthouseapp)
    ronin-37814 (at lighthouseapp) commented at 10:05 PM

    renamed thread local variable to cleanup_connection

  • ronin-37814 (at lighthouseapp)
    ronin-37814 (at lighthouseapp) commented at 10:03 PM

    added more real-world test case for nesting safety

  • ronin-37814 (at lighthouseapp)
    • Title changed from Adding using_connection method to Adding cleanup_connection method
    by ronin-37814 (at lighthouseapp) at 7:58 PM

    Realized all I really care about is cleaning up the connection at the end of the block, so here's a simpler version. It doesn't explicitly check out the connect...

  • ronin-37814 (at lighthouseapp)
    ronin-37814 (at lighthouseapp) commented at 6:29 AM

    example of why nesting protection is very helpful

    
    def x
      using_connection do
        User.all.each {|u| y(u) }
      end
    end
    
    def y(u)
      using_connection do
    ...