[R-sig-DB] Rdbi package plus draft proposal (was Re: Rdbi package)L

Luke Tierney |uke @end|ng |rom nokom|@@@t@t@umn@edu
Wed Oct 10 20:02:32 CEST 2001


On Wed, Oct 10, 2001 at 01:44:50PM -0400, Timothy H. Keitt wrote:
> >>
> >
> >They would be similar to the current  showConnections/getConnection.
> >
> 
> Actually, these might be useful for implementing the simplified 
> interface described above. But does this mean we will have to explicitly 
> destroy all connection and result objects? I think any objects generated 
> should be garbage collected like any other R object; otherwise you are 
> introducing a new object model. (I suppose connections could unregister 
> themselves from the driver when garbage collected.)
> 

Allowing DBconnections to be handled by the GC as a backup is I think
the right thing to do.  Since they involve scarce resource, explicit
closing should be encouraged.  The fact that the connection system
does not do this is I think unfortunate and something I think we will
have to revisit before too long (aside from the potential of leaving
connections open it is too easy for one function's use of connections
to trample anothers, especially if we go to any form of threading).

It is nevertheless possible to allow a list of open connections to be
obtained by using a weak reference mechanism. There is experimental
support for this in the devel version, with some notes on it at
http://www.stat.umn.edu/~luke/R/references/weakfinex.html (also off
the developer page).

luke

-- 
Luke Tierney
University of Minnesota                      Phone:           612-625-7843
School of Statistics                         Fax:             612-624-8868
313 Ford Hall, 224 Church St. S.E.           email:      luke using stat.umn.edu
Minneapolis, MN 55455 USA                    WWW:  http://www.stat.umn.edu



More information about the R-sig-DB mailing list