use ConnectionManagement middleware to close database connect automatically