> -----Original Message-----
> From: Tommy McNeely [mailto:[EMAIL PROTECTED]

> I am building an IRC based application "bot" (using libmysql) .. that 
> will take commands from users (!mybugs, !mybugs KEY !newbugs, 
> etc), do 
> SQL queries and of course dump formatted results back to the channel. 
> Currently its setup to open a single DB connection at initialization 
> and use that connection over and over... would it be better 
> or worse to 
> have it open/close a connection for each "command" in the way 
> a web app would?

There's a tradeoff here.

One connection is much more efficient.  If you're expecting frequent
commands this is definately a concern.  However, you'll need good error
handling, so your app can reconnect when that connection drops.  Granted,
you should have this *anyway*, but with the 'lots of little connections'
scheme you get a chance to start over every time a new command is issued.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to