I have a C# application with NHibernate that must do some operations over a SQL Server DB.
Our goal is to run this app multiple times in the same machine and also in other machines.
Actually app insert a row in a SQL Table and check if the first row with minimum date is the row with the correct PID and machine name so the app set the lock and do the work.
We have problems with this logic because app must also delete lock of other apps if the app that retain the lock is crashed.
Any hint about changing the lock architecture?
The problem is that app can run over multiple machines.