Caching the db connection may not work depending on your DB driver. A possible scenario is:
* Cold start, connection is established.
* Code runs and returns.
* Lambda stops the process entirely but retains the container.
* DB detects the socket is closed and kills the connection.
* Warm start.
* Code runs and fails because the connection is invalid.