Are next.js server-side database connections long-lived?

I have been using Next.js for a while and realized I am missing a core piece of understanding relating to how the framework actually operates under the hood, as it relates to server-side code.

Background

Next.js has three categories of code that runs server side (as far as I know):

  1. Code in Server Components (e.g. a normal async page component). It is possible to fetch external data in these server components. The code will never be executed by the browser.

  2. Code in Route Handlers (previously called API Routes). This code is executed when a machine (typically client side code in the browser) sends a request to the handler’s URL. Route Handlers are executed by app host (e.g. Vercel) on demand, in a node.js server environment. That server is started on-demand, whenever the function runs, thus there is a small lag to run these functions. This way of running functions is called “serverless”, because we do not need to run and manage our own server to execute them. Vercel, for instance, can execute these from a central server (e.g. in the US), or from one of many servers around the world (called the edge) that runs smaller and faster versions of the node.js runtime (called the edge runtime).

  3. Finally, Server Actions also execute server-side, in a node.js environment. They are similar to Route Handlers, in that they are “serverless” (called by client-side code in the browser, resulting in a server booting up to run the code and then shutting down).

As I was looking into Prisma, I read that the Prisma Client either establishes long-lived connections to a database, or short-lived connections. See: https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/databases-connections

Question

It is clear to me that Route Handlers and Server Actions will spawn short-lived node.js servers and thus create a new Prisma Client object per function call. As such, these Prisma database connections are short-lived, meaning the Prisma Client object only lives for the duration of the function call.

Firstly, is my above understanding correct?

Secondly, if we contact our database in a normal server component in a dynamic route (i.e. SSR, not SSG), will that be a short-lived node.js execution, or does that node.js environment persist / live over time (so Prisma Client objects are actually long-lived in that scenario)?