Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Transactions: The need to close a table.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Transactions: The need to close a table.
Divers
Thread ID:
00103510
Message ID:
00103510
Vues:
62
This one will be long, sorry, but it needs to be clearly explained.

I have 6 forms up on the desktop at once, each with it's own private datasession. This issue regards forms 1, 2 & 3. Form 1 is a parent to all the data on any of the other 5 forms.

Form 1 has it's table loaded in the DE as do each of the other forms.
Form 1 also has on occassion, a need to update the data on Forms 2 & 3. The records associated with forms 2 & 3 are not loaded into the DE of Form 1. The update is performed via an UPDATE-SQL call.

Form 1 has it's table buffered. The other tables associated with the update call are not buffered, but all are enclosed within a Transaction.

Here's what happens;

Begin Trans
Update command for form 1.
Check some parameters, if needed -
Update-SQL call for records that need to show up
in Forms 2 & 3. These are not in the DE of form 1
and not buffered except through the transaction.
Issue TableUpdate - which will only function for the
the record in Form 1.
End Transaction

I have found that the record in Form 1 gets properly updated
but that although stepping through the debugger shows the
child records also getting updated, the new data never really
gets to the database. It appears that the transaction is
not flushing their buffers. If I click on the Save button a
second time, it works fine......and will continue to work,
changing the values from Form 1 to 2 & 3. It just doesn't work
the first time through for reasons that I cannot explain.

I've also found that if I close the tables involved in the child
updates after the update-sql commands, the data is properly updated but I don't know the implication of this should the transaction fail even though these updates are the last thing to get executed.

Any ideas?

Thanks,
Steve
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform