Introduce timeouts for database connections and queries