connection = CreateDBConnetion();
try
{
_ = ExecuteQuery(connection, query);
OtherProcess();
}
catch (Exception ex)
{
// Error
// DB update opertions
}
finally
{
connection.close()
// Others
}
In the above code when some error occurred in otherProcess
method and DB connection is still being used by ExecuteQuery
method then while closing connection In finally block not working properly and also not throwing any exception. Not moving forward from from connection.close()
and still ExecuteQuery
method running in the background.
Any idea why it's not allowing me to closed connection while it's being used by some other process.