About DB Connection Closer node

Hello.

I was wondering if the “DB Connection Closer” node is always needed when using the “DB Connection” node.

In particular, I was wondering if using DB nodes automatically closes the session.
(such as DB Table Selector, DB Joiner …)

I think it depends on the type of DB, but I would like to know what the default options are for the DB nodes.

I’d appreciate it if you could help me.

Thanks,
hhkim

Hello @hhkim,

don’t think it is necessary to always close connection with DB Connection Closer node.

Check this topic for more info:

Br,
Ivan

Thank you for your answer.

I think I need to explain my question further.

I need to make sure to close the DB session after the task is completed.

In this case, I would like to know if the session is automatically closed without using the DB Connection Closer node.

Thanks,
hhkim

Hi @hhkim, if you reset the workflow (or at least reset the db connector), I believe the db session will close. Other than that, as far as I know the session will stay connected until such time that the database itself decides to terminate the connection (e.g. session timeout) or it is for some other reason disconnected outside of KNIME.

If you execute a workflow and come back an hour later, and add another query node onto the db connection, you will quite possibly (probably?) find the session is still available, so I certainly wouldn’t assume it will be closed at any specific moment after workflow completion, but for most databases, I think it is likely that something will eventually cut the connection.

If you need to be sure the session is closed, I think you should add a DB Connection Closer. Is there any reason why you wouldn’t want to just add that if you need to be certain of closing the session?

Thank you for your answer.

Most DBs have session limits, so it’s important to disconnect when you’re done so that other users can use them.

The reason I was thinking about it is because I have a lot of managed workflows, and I need to add a close DB connection node for each of them, which is a bit cumbersome.

But for the sake of system stability, I think I should add a close DB Connection Node for each of them.

Thanks,
hhkim

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.