-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple queries from AbstractTextTableWriter? #71
Comments
Some writers need to make multiple passes through the table row stream to do the write, others can get away with a single pass. The FITS writer for instance needs to know the number of rows up front. If you write the Machinery is provided for this kind of stream-to-cache operation. The most straighforward way to do it is to call For instance:
|
Thanks, randomTable seems to have fixed the issue. |
I am trying to upgrade from stil 4.0 to 4.3, and my tests failed when trying to access a ResultSet that was already closed in a custom StarTable I wrote.
I digged a little bit and I found that uk.ac.starlink.table.formats.AbstractTextTableWriter#writeStarTable invokes getRowSequence() twice, and uk.ac.starlink.table.jdbc.JDBCStarTable#getRowSequence (haven't checked the others) creates a DB connection and runs a query everytime it's invoked.
This looks very inefficient: is it possible to read the data once in writeStarTable? I could change my implemementation to do something similar to what the JDBCStarTable does, but it doesn't look like the best solution.
The text was updated successfully, but these errors were encountered: