#10 Try to create and close connection to DB on the same level of visibility (if you create it statically then close also on the same way).