Git Product home page Git Product logo

Comments (6)

metaskills avatar metaskills commented on May 17, 2024

The above code looks like a FreeTDS trace? Perhaps a FreeTDS bug? What version are you using?

from tiny_tds.

michaelkirk avatar michaelkirk commented on May 17, 2024

also: freetds-dev version 0.82-7 package on debian

from tiny_tds.

michaelkirk avatar michaelkirk commented on May 17, 2024

I've found an interesting work around...

I'm doing something like this:
client.execute("select * from tablename").each do |row|
MyClass.create(row)
end

The above loop breaks 200 or so iterations in.

When I instead do:

rows = client.execute("select * from tablename")
rows.count # force lazy evaluation of entire iterator ?
rows.each do |row|
  MyClass.create(row)
end

I'm wondering if client.execute is returning a lazily evaluated iterator, and that the problem lies therein somehow. Could a timeout occur during looping over a result set?

from tiny_tds.

metaskills avatar metaskills commented on May 17, 2024

Yea, the README explains this behavior.
https://github.com/rails-sqlserver/tiny_tds

If you use result.each(:cache_rows => false) it alleviates the need for putting the entire collection into memory just to iterate over it. I have not tested this raw behavior in a production env, especially one where the live read from the wire of the results takes a long time (increased by what happens in the block. For instance.

result = client.execute("SELECT * FROM [big_users_table]")
result.each(:cache_rows => false).each do |user_row|
  sleep(2)
end

YMMV when doing this. I am curious, on how big the select would have taken and how long would the sum of each block take in your case?

from tiny_tds.

metaskills avatar metaskills commented on May 17, 2024

Closing this issue. Please reopen if there is more information and/or actions that I need to take.

from tiny_tds.

sahib1 avatar sahib1 commented on May 17, 2024

I get the following error when I read more than 100 message at consumer side. I publish messages to RabbitMQ and have run a consumer to read from RabbitMQ it breaks when find more than 100 or sometimes 90's messages the error is given below

ruby: util.c:95: tds_set_state: Assertion `tds->state < (sizeof(state_names)/sizeof(state_names[0]))' failed. Aborted

from tiny_tds.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.