Updated DB connection management.