properly close database connections when issuing DDL