What is the best way, to catch a table lock exception with ado.net and iAnywhere.Data.SqlAnywhere.EF6
? My problem is, that command.ExecuteNonQuery
cause a SAException
which contains the message, that a user has locked all rows in a table.
The problem is, that it is a general SAException
, not a specific one like SATableLockException
, which would be nice.
Now the question: how to detect without using the error message, that the error is a table lock exception?
Thank you very much!
Ok, i found a solution for this. I just cast the exception to
SAException
and userd the Error-Code property (thank you @tzup):Example: