Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Data Change Detection??
Tue, May 21 2024 5:18 PMPermanent Link

Ian Branch

Avatar

Hi Team,
If I have App A open, it has read and is displaying a record.
App B then changes a value in one of the fields in the relevant table.
How can App A detect this and update itself?

Ian
Wed, May 22 2024 2:42 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ian


Do A & B both access the same file and share the same catalog/config (seems like it from your post) if so are you using optimistic or pessimistic locking? Can both A & B alter the record? If only B can make changes then I'd simply have a timer and refresh the table/query in A every so often. If both can alter the data then you need something more sophisticated

ElevateDB has a RecordChangeDetection property but I don't think it will do what you want.

A few links for you to peruse - the torry one is safe but you may get a warning (I do from MBAM but over the years I've never had a problem with Torry)

https://torry.net/components/files-and-drives/notification/

https://stackoverflow.com/questions/3418562/delphi-notification-when-a-file-gets-updated

https://blogs.embarcadero.com/windows-management-instrumentation-made-easy-in-your-delphi-apps-with-ultimate-component-suite/


Rolling your own isn't massively difficult. The approach would depend on wether or not A & B are accessing the same table. If you want to do something like that lets take it off NG.



Roy Lambert
Wed, May 22 2024 2:59 AMPermanent Link

Ian Branch

Avatar

Hi Roy,
Thank you for your comprehensive response.  Appreciated.
>>Do A & B both access the same file and share the same catalog/config (seems like it from your post)
Yes.
>>are you using optimistic or pessimistic locking?
Pessimistic.
>>Can both A & B alter the record?
Yes but A looks after itself through .Refresh.

>>the torry one is safe but you may get a warning (I do from MBAM but over the years I've never had a problem with Torry)
Which Torry one?

>>Rolling your own isn't massively difficult. The approach would depend on wether or not A & B are accessing the same table. If you want to do something like that lets take it off NG.
OK.  I will email you.

Regards & Tks,
Ian
Wed, May 22 2024 3:16 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ian

>>>the torry one is safe but you may get a warning (I do from MBAM but over the years I've never had a problem with Torry)
>Which Torry one?

The first of the three links
Wed, May 22 2024 3:41 AMPermanent Link

Ian Branch

Avatar

Roy Lambert wrote:

Ian

>>>the torry one is safe but you may get a warning (I do from MBAM but over the years I've never had a problem with Torry)
>Which Torry one?

The first of the three links

I realise that, I meant which one of the components listed in the link?
Wed, May 22 2024 4:25 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ian

>>>>the torry one is safe but you may get a warning (I do from MBAM but over the years I've never had a problem with Torry)
>>Which Torry one?
>
>The first of the three links
>
>I realise that, I meant which one of the components listed in the link?

Ah. No idea I thought you might be bored so you could have a look but fear not I'll investigate.

Roy
Image