Skip to content
Prev 18916 / 63424 Next

Enhancement request: anonymous connections

On Sun, 1 Jan 2006, Duncan Murdoch wrote:

            
It was not even a bug in load: close() and open() are not pairs.  (I 
didn't pick the names!) Your `fix' destroys a connection, which is 
not the documented behaviour and far more dangerous than leaving it open.

The lifecycle of a connection is  (see e.g. my R-news article)

 	create->open->close->destroy

and close() does both of the last two.  Please revert this change. 
Ideally we would close and not destroy if the connection was opened, but 
that needs a better C-level interface in place of this R-level one.
However, that just isn't how connections are documented in the Green Book 
(referenced on all the relevant help pages, so required reading) and 
getConnection() allows you to create an R object pointing to a connection 
that previously had none.  The OP has never told us what `anonymous 
connections' are, but it is quite possible that his unstated ideas are 
incompatible with the documentation.