Subject | Re: [firebird-support] get_lock / release_lock |
---|---|
Author | Kjell Rilbe |
Post date | 2008-07-31T13:18:36Z |
Martijn Tonies wrote:
1. User 1: update <table> set LockedByUser = 'Me' where RecId =
something and LockedByUser is null, then check that 1 rec was updated.
If not, then someone already had the lock.
I expect this would work...?
Kjell
--
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64
> > Can't they put in a where condition in the update double checking thatI expect Steve meant:
> > the locked_by is null?
>
> Sure, but what if it was unlocked already by a user, then it will
> overwrite the changes without even knowing there were changes.
1. User 1: update <table> set LockedByUser = 'Me' where RecId =
something and LockedByUser is null, then check that 1 rec was updated.
If not, then someone already had the lock.
I expect this would work...?
Kjell
--
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64