DB locked by the robot

Hello all,

I’ve noticed that if the execution of a UiPath.Database.Activities.Insert inside a UiPath.Database.Activities.startTransaction stops due to any error, the used connections is not closed and DB lock needs to be killed in the DB itself.

Is this an expected behavior? Shouldn’t the lock be dropped once the process execution ends?

@lore95acosta

Welcome to the community

This is expected as if the activity does not end it leaves the current state..the connection ends only when activity completes

You might need to use try catch inside it and let the transaction scope end and then throw

Cheers

1 Like

Hi @lore95acosta

Always scrap start transaction activities inside a Try/catct/finally
in catch - use rollback transaction
in finally - ensure the connection is closed/disposed.

1 Like

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