Make only a single database connection and close it when you're done with it. #131
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For cases with more than a few hundred CSVs, in 0.3.3 we've been getting SQLite writing failures with variants of
OSError: [Errno 24] Too many open files: '/tmp/tmpyzcy0lbx'
. This seems to be due to that, when we moved to SQAlchemy from odo, connection generation was added without closing, and it was .I've tested both creating the connections from a null pool and then closing the connections a) just where they were, in
into
, and b) once per set, inseed
; the latter seems to be about 5% faster, so that's the change I'm looking to pull, but if for whatever reason we want to do it insideinto
in the future that seems to be also fine!