[Fix] database connection management