I have created a small application in C#. In that I have coded try...catch
blocks on saving as follows.
Try
{
command.BeginTransection();
//execute statements here
command.commit();
}
Catch
//Here I get error, which is raised from Sql trigger
command.rollback();
Finally
In my trigger
CREATE TRIGGER [dbo].[table_insert]
ON [table] FOR INSERT
BEGIN
//If some condition not matched as per my criteria, I have raise error from trigger
RAISEERROR
END;
I am getting error in my C# code, and I am rollback my transaction, but still my table is showing locked, and another user work on my application from network getting "connection timeout" error.
So, I don't understand what is the problem is?