From 891049d55ccfef7714c8833ced8a8f908d42e050 Mon Sep 17 00:00:00 2001 From: "terry%mozilla.org" Date: Thu, 3 Jun 1999 20:32:20 +0000 Subject: [PATCH] Keep the connection to the database open for as little as possible, and that while in a lock. That way, multiple checkins all happening at once can't overflow mysql with too many connections. git-svn-id: svn://10.0.0.236/trunk@33571 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bonsai/addcheckin.tcl | 2 +- mozilla/webtools/bonsai/globals.tcl | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/mozilla/webtools/bonsai/addcheckin.tcl b/mozilla/webtools/bonsai/addcheckin.tcl index 97a3c4e9bc3..8b2f5f61695 100755 --- a/mozilla/webtools/bonsai/addcheckin.tcl +++ b/mozilla/webtools/bonsai/addcheckin.tcl @@ -116,7 +116,7 @@ if {![info exists forcetreeid]} { ConnectToDatabase AddToDatabase $appendjunk $plainlog - + DisconnectFromDatabase } Unlock diff --git a/mozilla/webtools/bonsai/globals.tcl b/mozilla/webtools/bonsai/globals.tcl index 2c7dc9f4dcb..6433c7ee58f 100755 --- a/mozilla/webtools/bonsai/globals.tcl +++ b/mozilla/webtools/bonsai/globals.tcl @@ -91,6 +91,15 @@ proc ConnectToDatabase {} { } } +proc DisconnectFromDatabase {} { + global mysqlhandle + if {[info exists mysqlhandle]} { + mysqlclose $mysqlhandle + unset mysqlhandle + } +} + + proc SendSQL { str } { # puts $str global mysqlhandle errorInfo