"DB Connection Closer" useful in interactive webapps?

Hi,

I use some webapps on KNIME server and recently wondered if I should close the DB connections in webapps. I found the entry on KNIME Best Practices Guide that says “Close database connections with the DB Connection Closer node”. So tried to use it (with a forwarded DB session through all the components):

  • in the last component
  • behind the last component

But this caused small or big problems:

  • the DB connection closes in the webapps after some use despite the fact that the DB should reconnect
  • or I get a “Next” button in the webapp despite the fact that there is no following component.

Hi Spider :spider: :smiley:

Yes, it definitely makes sense to close the connection to the DB. Are you adding the DB Connection Closer at the right point in time? To make sure that it only closes (so that the node only executes) after the last action that needs to be taken, you can add a dummy flow variable from the last node to the DB Connection closer as my colleague has done here Best Practices for ETL on Customer Data – KNIME Hub.

Do let us know if this doesn’t solve the issue!

Best,
Karen

1 Like