Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is it OK to code database i/o, in timer event?
Message
De
22/03/2002 14:33:11
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Is it OK to code database i/o, in timer event?
Divers
Thread ID:
00636215
Message ID:
00636215
Vues:
53
I wrote a timer event routine that loops through a table and conditionally updates data, inserts data etc.

The timer is done with 'define class' in code, not through the visual timer/control, dropped on a form. The timer instance variable is public, so it is always running. The tables it operates on are opened up in code, not in a form, and not in a private data session.

The rest of the operations that the application performs are also on tables that are not defined in a private data session. (and by the way, redesigning the application for private data sessions, at this point is not even feasible. This is a bar code application that has no user interface, other than one text box on a form, and further, it also needs the ability to be able to call a method in the valid of a 'dos style' get where there is no vfp form, so I don't know how to do a private data session for this)

So I am wondering, for example, whether an operation that moves the record pointer in my timer will cause an operation in another part of the application to fail. So if another module of the application moves the record pointer, then attempts to read some value from the table, but the timer moves the record pointer again, in between the time the other module moves the record pointer, and the data is read into a variable, will my application break.

Or, is it the case that the timer event executes in its entirety, before returning control to the rest of the running application. Does it run asynchronously, in which case this won't be a problem (as long as I reset record pointers, etc., at then end of the timer routine.

Also, one other point. I also have another simpler timer running at the same time. It just refreshes a value in a variable. But I am under the impression that it might also be problematic to have more than one timer running at time, based upon the comments made in another thread. The comments were vague. So I am hoping some clarification whether this too is a problem.

TIA
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform