Hi Simon, If your job reads or writes to a DB, I would suggest to use one of the already existing Flink sources or sinks, as this allows for efficient connection handling and managing.
If you want to write intermediate data to a DB from an operator, then I suppose that you should implement your own custom operator that opens a DB connection in the open() method and closes it at close(). If you are planning to do so, I think that code of your custom operator would be the same as the StreamFlatMap, with the addition of the openDBConnection method in the open(), and you should also override the close() method of the AbstractUdfStreamOperator to 1) call super.close() and 2) close the db connection. Let me know if this works, Kostas > On Jul 7, 2016, at 10:38 AM, simon peyer <simon.pe...@soom-it.ch> wrote: > > Hi guys > > Is there a easy way to handle external DB connections inside a RichFlatMap > Function? > > --Thanks Simon