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.

This project is archived and is in readonly mode.

Console --sandbox 2.1.2 not fixed?

#1194

As first described on Rails talk, script/console -s gives the error:


.../vendor/rails/activerecord/lib/active_record/base.rb:1824:in `method_missing':NoMethodError: undefined method `increment_open_transactions' for ActiveRecord::Base:Class

on Edge. I'll also add that it doesn't roll back transactions.

The attached patch fixes the problem.

Reported by Matt Jones · October 8th, 2008 @ 10:01 PM

State: resolved
Milestone: 2.x
Assigned to: Repository Repository
Importance: none

Activity

  1. Repository
    Repository
    • State changed from new to resolved

    (from [aa4a7c35309ff95ef1165844d637f7e583ac20dd]) Fix script/console --sandbox warning. [#1194 Console --sandbox 2.1.2 not fixed? state:resolved]

    Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...

    October 9th, 2008 @ 01:36 AM

  2. Repository
    Repository

    (from [bbb2fda11564b2d40c6c07c5a3c91cccb77fb653]) Fix script/console --sandbox warning. [#1194 Console --sandbox 2.1.2 not fixed? state:resolved]

    Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...

    October 9th, 2008 @ 01:41 AM

  3. Repository
    Repository

    (from [197e61c5b1df89260ee5077c7e3c94e61a51b6a2]) Revert "Fix script/console --sandbox warning. [#1194 Console --sandbox 2.1.2 not fixed? state:resolved]"

    This reverts commit bbb2fda11564b2d40c6c07c5a3c91cccb77fb653. http://github.com/rails/rails/co...

    October 24th, 2008 @ 09:15 PM

  4. MarcD
    MarcD
    • Title changed from Console --sandbox does not work to Console --sandbox 2.1.2 not fixed?
    • Assigned user set to Repository

    Even though it seems there is a patch for this in rails 2.1.2, I am still getting this error. Any ideas why? Maybe this ticket should be reopened? I have a clean install of rails 2.1.2, mysql-2.7. I should not be getting this error.

    Loading development environment in sandbox (Rails 2.1.2) Any modifications you make will be rolled back on exit /usr/lib/ruby/gems/1.8/gems/rails-2.1.2/lib/console_sandbox.rb:2:NoMethodError: undefined method increment_open_transactions' for #<ActiveRecord::ConnectionAdapters::MysqlAdapter:0xb6e89fe8>

    If I revert the diff back to the way it was in rails 2.1.0 then the warning goes away. Here is the revert of the diff.

    +ActiveRecord::Base.send :increment_open_transactions -ActiveRecord::Base.connection.increment_open_transactions ActiveRecord::Base.connection.begin_db_transaction at_exit do ActiveRecord::Base.connection.rollback_db_transaction + ActiveRecord::Base.send :decrement_open_transactions - ActiveRecord::Base.connection.decrement_open_transactions end

    For some reason I am getting errors on transactions in the console. With 2.1.2 as is and with 2.1.2 reverting console_sandbox.rb. I get the same error for both:

    ArgumentError: wrong number of arguments (0 for 1)

        from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/timestamp.rb:33:in `changed?'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/timestamp.rb:33:in `update'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/base.rb:2483:in `create_or_update_without_callbacks'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/callbacks.rb:207:in `create_or_update'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/base.rb:2217:in `save_without_validation!'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/validations.rb:921:in `save_without_dirty!'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/dirty.rb:83:in `save_without_transactions!'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/transactions.rb:110:in `save!'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/transactions.rb:79:in `transaction'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/transactions.rb:98:in `transaction'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/transactions.rb:110:in `save!'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/transactions.rb:118:in `rollback_active_record_state!'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/transactions.rb:110:in `save!'
        from /home/marc/rails_projects/fb_app/vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:116:in `register'
        from /home/marc/rails_projects/fb_app/vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:423:in `method_missing'
        from (irb):4>>
    
    

    November 18th, 2008 @ 07:45 AM