This project is archived and is in readonly mode.

#1194 ✓resolved
Matt Jones

Console --sandbox 2.1.2 not fixed?

Reported by Matt Jones | October 8th, 2008 @ 10:01 PM | in 2.x

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.

Comments and changes to this ticket

  • Repository

    Repository October 9th, 2008 @ 01:36 AM

    • State changed from “new” to “resolved”

    (from [aa4a7c35309ff95ef1165844d637f7e583ac20dd]) Fix script/console --sandbox warning. [#1194 state:resolved]

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

  • Repository

    Repository October 9th, 2008 @ 01:41 AM

    (from [bbb2fda11564b2d40c6c07c5a3c91cccb77fb653]) Fix script/console --sandbox warning. [#1194 state:resolved]

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

  • Repository

    Repository October 24th, 2008 @ 09:15 PM

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

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

  • MarcD

    MarcD November 18th, 2008 @ 07:45 AM

    • 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>>
    
    
  • klkk

    klkk May 23rd, 2011 @ 03:09 AM

    • Importance changed from “” to “”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Referenced by

Pages