Information générale
Catégorie:
Codage, syntaxe et commandes
>I am working on an application which submits data to a table for processing by another application. The second application polls that table for new entries, takes whatever action is requested and then updates the record in the table, marking it as processed. The problem is that my first application does not see the changes made to the record by the second application. Is there a way to force foxpro to re-read the values directly from disk without closing and reopening the table?
>
>The following closely resembles the code that I am using:
>
>use transactions shared in 0
>select transactions
>append blank
>replace transactions.sequence with GetSequence()
>replace transactions.function with 32
>replace transactions.status with 'A'
>unlock
>
>counter=0
>* transaction processor should change status flag to 'S' or 'X'
>* when it is done with the record.
>do while transactions.status = 'A' and counter<10
> wait window "Waiting for transaction processor" timeout 3
> counter = counter + 1
>enddo
>
>do case
> case transactions.status = 'A'
> ** transaction processor not responding
> ** this is what I always get, because the value is not
> ** refreshed from disk
> case transactions.status = 'X'
> ** error
> case transactions.status = 'S'
> ** success
> otherwise
> ** shouldn't happen
>endcase
Hi,
It's been a bit since looking into it, but I believe that if you use a SQL-SELECT statement to retrieve your data, that it will read from the disk. I'm not sure judging from the other responses and your code whether that will work for you.
Steve
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement