The problem is that I am not able to disconnect the database once it is instantiated. The db connection lives as long as the class. :( Continue reading...