Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Begin Transaction ....
Message
De
27/06/2002 22:44:14
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Begin Transaction ....
Divers
Thread ID:
00673158
Message ID:
00673158
Vues:
49
hi,

I have a Visual Foxpro Ver7 program which opens two databases: stock and
account.
When an invoice is issued, it will update records to tables in both
databases using the Begin..End Transaction feature (without Table Buffering). The problem is, it is unstable and sometimes there are records not being appended to the account tables or the index not being synchronised. My suspicion is because I use the
transaction processing against two different databases incorrectly. Here is a rough
sample of my updates:

BEGIN TRANSACTION
Append/Replace tables in Stock DB
..
Append/Replace tables in Account DB
..
Append/Replace tables in Stock DB
..

if no error detected
END TRANSACTION
else
ROLLBACK
endif

I can't seem to find examples in documentation that use more than one
database. Does anyone know how it is done?? Do I need to nest transactions as such:

SET DATABASES TO STOCK
BEGIN TRANSACTION
Append/Replace tables in Stock DB
..
SET DATABASES TO ACCOUNT
BEGIN TRANSACTION
APPEND/REPLACE TABLES IN STOCK DB
END TRANSACTION
..
..
Append/Replace tables in Stock DB
..
..
SET DATABASES TO ACCOUNT
BEGIN TRANSACTION
APPEND/REPLACE TABLES IN Account DB
END TRANSACTION
..
..
Append/Replace tables in Stock DB
..
IF no error detected
END TRANSACTION
ELSE
ROLLBACK
ENDIF

Thanks
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform