Do you have persistent connections turned on? That can cause problems. In Q2A it's this option in qa-config.php:
define('QA_PERSISTENT_CONN_DB', false);
But note that even when this is set to false, if you have persistent connections elsewhere in your own PHP code it may break things. If you're on shared hosting there may not be anything you can do about it.