Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Force read from disk
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
Suivant
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