hello,

I am writing a little vocabulary trainer with ruby,  and postgresql
and the cool ruby-dbi.

There are some classes, each with several methods, many of them
making connections to the database.

Is it a good idea to create a database (e.g. called "dbh")  handle in each 
method and call at the end 
dbh.disconncect
that is, the dbh is local to each method

this would be a lot of connects and disconnects, but maybe the
risk of data los is smaller.

on the other hand: are the performace disadvantages with this

another idea would be to make dbh global because several classes
need a database handle.

a compromise would be to make "dbh" a class variable for each
class that needs it.

any thoughts??

regards
markus


-- 
Markus Jais
http://www.mjais.de
info / mjais.de
The road goes ever on and on - Bilbo Baggins