What are you on about? Gets called "first" and "second" - in relation to what? When it is called second what are you referring to that is called before it?
OnPlayerDisconnect gets called after OnGameModeExit. If you close the server connection to a MySQL database on the last one, everything goes wrong.