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.

Windows & sqlserver - ActiveRecord::StatementInvalid (NoMemoryError: failed to allocate memory: SELECT

#6130

ActiveRecord::StatementInvalid (NoMemoryError: failed to allocate memory: SELECT

Even for simple 50 item LIMITED-SMALL-ActiveRecord Object queries like this:
NoMemoryError: failed to allocate memory: SELECT TOP (50) [items].* FROM [items])

WORKING FIX:
Convert all ntext fields to text.

Reported by Rhett Barber · December 7th, 2010 @ 11:59 PM

State: stale
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Rhett Barber
    Rhett Barber

    @items = Item.limit(50).all

    December 8th, 2010 @ 12:03 AM

  2. Rhett Barber
    Rhett Barber

    This happens to queries at random. Sometimes it will let them through, other times it gives this error. I have tried serving with mongrel, thin, rails s. I have tried all the 3.x versions of the activerecord-sqlserver-adapter.

    December 8th, 2010 @ 12:42 PM

  3. Rhett Barber
    Rhett Barber

    Windows 7 Ultimate x64 dual quad with 8gb ram.

    December 8th, 2010 @ 01:15 PM

  4. Rhett Barber
  5. Rhett Barber
    Rhett Barber

    Commented out this

    rescue Exception => e

    message = "#{e.class.name}: #{e.message}: #{sql}"

    @logger.debug message if @logger

    raise translate_exception(e, message)

    seems to work somehow. Have not extensively tested.

    December 8th, 2010 @ 04:12 PM

  6. kdgundermann
    kdgundermann

    Are you using the sqlserver adapter with ruby-odbc or with TinyTDS ?

    December 8th, 2010 @ 09:29 PM

  7. Rhett Barber
    Rhett Barber

    http://www.ch-werner.de/rubyodbc/

    It contains the files odbc.so and odbc_utf8.so which need to be copied into the .../ruby/1.8/i386-msvcrt directory of MSVC based Ruby 1.8 installations.

    and

    gem 'rails', '3.0.1'
    gem 'activerecord-sqlserver-adapter' , '3.0.6'

    I BELIEVE COMMENTING OUT THE ABOVE HAS FIXED THIS ISSUE TEMPORARILY, I NEED MORE TIME TO CONFIRM.

    December 8th, 2010 @ 10:42 PM

  8. Rhett Barber
    Rhett Barber

    It is happening again. I will work to narrow the causes.

    December 9th, 2010 @ 09:23 PM

  9. Rhett Barber
    Rhett Barber

    Restarting the computer allows the exact query that failed to execute. Restarting mongrel and closing the command prompt and then restarting mongrel or thin does not help (the exact same query fails-even simple ones).

    December 9th, 2010 @ 11:29 PM

  10. Rhett Barber
    Rhett Barber

    Convert all ntext fields to text. I knew this before but thought I had already converted all columns. I missed two in this table. I will test thoroughly tomorrow and report status. It works right off.

    December 22nd, 2010 @ 11:06 PM

  11. Rhett Barber
    Rhett Barber

    Still working fine. RAILS 3 IS AWESOME. THANKS RAILS CONTRIBUTORS!! GOD BLESS YOU. MERRY CHRISTMAS.

    December 23rd, 2010 @ 08:44 PM

  12. rails
    rails
    • State changed from new to open

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    March 30th, 2011 @ 01:00 AM

  13. rails
    rails
    • State changed from open to stale

    March 30th, 2011 @ 01:00 AM