Hi Jacob,

Flink jobs, tasks typically run on multiple nodes/servers. This means that
it is not possible to have a connection shared on job level.

You can read about the architecture in more detail in the docs. [1]

I hope this helps,
Péter

[1] -
https://nightlies.apache.org/flink/flink-docs-release-1.19/docs/concepts/flink-architecture/

On Thu, Mar 21, 2024, 13:10 Jacob Rollings <jacobrolling...@gmail.com>
wrote:

> Hello,
>
> Is there a way in Flink to instantiate or open connections (to cache/db)
> at global level, so that it can be reused across many process functions
> rather than doing it in each operator's open()?Along with opening, also
> wanted to know if there is a way to close them at job level stop, such that
> they are closed at the very end after each operator close() method is
> complete. Basically the idea is to maintain a single instance at global
> level and close its session as a last step after each opertor close is
> complete.
>
>
> Regards,
> JB
>

Reply via email to