C
cverbiest
Guest
We found that current-changed is not reliable. Any find that fetches the record after it has been changed, anywhere in the session, will cause the current-changed to be false. In an event driven UI there is no way of telling what might have been activated by the user between the original find-display-enable and the find-current+test-current-changed. I'm looking for an alternative. I'm thinking of creating a checksum of the orignal record to compare instead of using current-changed but I wonder if there are other approaches sample to demonstrate issue create sports database start server start 2 sessions with -rereadnolock, or change the lock in external_find.p to share-lock run find_current.p in the first session, leave it at the pause. run upd_customer.p in the second session. return to the session with find_current and press space this session now show current changed as false. In this sample it's prettyn obvious external_find causes it to fail, in an event driven UI with optimistic locking it's impossible to guarantee the user will not start something that causes a find. /* external_find.p */ &scoped lock no-lock define buffer lb-customer for customer. def input param ifirst as log. if ifirst then find first lb-customer {&lock}. else find last lb-customer {&lock}. /* find_current.p */ find _myconnection. disp _myconnection._MyConn-Pid. find first customer no-lock. pause. run external_find.p (yes). find current customer exclusive-lock. message current-changed customer. /* upd_customer.p */ find _myconnection. disp _myconnection._MyConn-Pid. find first customer. Customer.Comments = substitute("updated by &1 at &2", _MyConn-Pid, now).
Continue reading...
Continue reading...