Optimistic locking - once again
Optimistic locking - once again
I found this information in the previous messages:
>> How do I actually check whether the row has been updated by another user?
> Setting CheckRowVersion to True is enough.
I set CheckRowVersion to True in your example SdacDemo-> CachedUpdates, I added a TimeStamp field to the dbo.emp table, I opened 2 copies of sdacDemo and I was editing the same record in the same time. Nothing happend.
In that case should I get any error message or there is another way to catch this event ?
I use Sdac 4.30, Delphi 5, MsSql 2005.
Thanks for your help.
ZS
>> How do I actually check whether the row has been updated by another user?
> Setting CheckRowVersion to True is enough.
I set CheckRowVersion to True in your example SdacDemo-> CachedUpdates, I added a TimeStamp field to the dbo.emp table, I opened 2 copies of sdacDemo and I was editing the same record in the same time. Nothing happend.
In that case should I get any error message or there is another way to catch this event ?
I use Sdac 4.30, Delphi 5, MsSql 2005.
Thanks for your help.
ZS
I set DMLRefresh, CheckRowVersion to True and it works almost in the way I want, I've got an optimistic locking.
But I still have a little problem.
When 2 users edit the same record in the same time, one of them has got an error message "Update failed. Found 0 records".
I'wouldn't like to get this message - is it possible to get exactly message "error optimistic transaction" or something like this ?
I know that I can replace this message "Update failed. Found 0 records" to "error optimistic transaction" in PostError event, but I would like to avoid this situation, because this error message ("Update failed. Found 0 records") could be also cause by another database/sdac event (I find a lot of examples with this error message on this forum).
kind regards
ZS
But I still have a little problem.
When 2 users edit the same record in the same time, one of them has got an error message "Update failed. Found 0 records".
I'wouldn't like to get this message - is it possible to get exactly message "error optimistic transaction" or something like this ?
I know that I can replace this message "Update failed. Found 0 records" to "error optimistic transaction" in PostError event, but I would like to avoid this situation, because this error message ("Update failed. Found 0 records") could be also cause by another database/sdac event (I find a lot of examples with this error message on this forum).
kind regards
ZS
side effect DMLRefresh = True (text field)
when I set DMLRefresh := True I got an error message when I make post:
"Bad parameter [my_text_field_name] Output parameters "text", "ntext", or image are not acceptable", if I use a text type field in TMSQuery.
How to avoid this error ?
I don't have this error if I Generate SQL - but in that case optimistic locking doesn't work
"Bad parameter [my_text_field_name] Output parameters "text", "ntext", or image are not acceptable", if I use a text type field in TMSQuery.
How to avoid this error ?
I don't have this error if I Generate SQL - but in that case optimistic locking doesn't work
