You can force socket.io to use only long-polling:
io.set('transports', ['jsonp-polling']);
But I don't think long-polling is the solution you are looking - for. You should be independet from the underlying technique used. I might do something like this:
function writeToMysqlDb(data) {
mySqlDriver.write(data); //whatever you use to write data to MySql
socket.emit('dbChanged', data); //send the same data to all connected clients
};
I would leave the transports to the default options: "transports defaults to websocket, htmlfile, xhr-polling, jsonp-polling"