7fe80d37afd296f8db0058f3e444737ff88ff80e
markd
  Mon Jul 26 23:50:19 2010 -0700
address problem of hgTables consuming all available sockets before TIME_WAIT period by using the connection cache. Have hgTable log connection usage information to help ensure this is fixed
diff --git src/hg/lib/mdb.c src/hg/lib/mdb.c
index 28d90ea..a4f8698 100644
--- src/hg/lib/mdb.c
+++ src/hg/lib/mdb.c
@@ -6,6 +6,7 @@
 #include "linefile.h"
 #include "dystring.h"
 #include "jksql.h"
+#include "hdb.h"
 #include "mdb.h"
 
 static char const rcsid[] = "$Id: mdb.c,v 1.8 2010/06/11 17:11:28 tdreszer Exp $";
@@ -1942,13 +1943,13 @@
         }
     }
 
-struct sqlConnection *conn = sqlConnect(db);
+struct sqlConnection *conn = hAllocConn(db);
 char *mdb = mdbTableName(conn,TRUE);  // Look for sandbox name first
 if(tdb != NULL && tdb->table != NULL)
     table = tdb->table;
 if(mdb != NULL)
     mdbObj = mdbObjQueryByObj(conn,mdb,table,NULL);
-sqlDisconnect(&conn);
+hFreeConn(&conn);
 
 // save the mdbObj for next time
 if(tdb)