Computer Science, asked by Harshikarnavat4150, 10 months ago

At the end of the execution of workflow1, which retrieves some items from a database, is the database connection closed automatically

Answers

Answered by HeroicAyush
0

Answer: Yes surely.

Answered by lovingheart
0

The database connections might be closed after a period of time, may be when the garbage collector checks for unused objects. But it is always recommended to close the database connection whenever the task is over and reopen whenever the next query is sent. These avoid unwanted objects to be on the memory which diminishes the system speed. This is normally handled in the try catch finally block in the front-end application where the connection is being opened in the try block, catch if any error and at the end close the database connection in the finally block.

Similar questions