in reply to check if DBI is still connected

You need not to develop own daemon, think about Apache::DBI, which _may_ help, or about SQL Relay, which is real connection pool daemon (but I have no practice with it :( )