Skip to content
Prev 26738 / 63424 Next

isOpen on closed connections

I'd support a change, to having a closed-but-not-invalid status for a
'rw' connection, and to have a usable 'isOpen'. The suggestion of
relying on user-code to always "housekeep" after calling 'close', eg by
setting to NULL, seems a bit risky as a guideline for R as a whole (one
can never tell what convention a different author's code might follow).
And the 'myOpen' solution will work (I'm about to use it myself) but
cumbersome if everyone has to do it. With things as they are, I can
foresee a stream of "why does.../RTFM" emails...

Perhaps the more fundamental issue is whether 'getConnection' should
actually throw an error. 
I'm getting bitten by this in R 2.6.1-- I use 'getConnection' in an
'on.exit' statement (where I can't be sure of the state of the
connection), and it's throwing an error instead of returning NULL as it
used to (and as the documentation still states).