Perhaps this function is not closing the connection properly
sp_MYSP
There is a chance that on one of the records it fails and throws an exception so then it causes call to end prematurely and therefore not calling the close on the database.
It's always a good idea to have the close for a stream or database connection in a final scope. That way if it fails, the connection / stream is always closed.