Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Begin Transaction ....
Message
From
27/06/2002 22:44:14
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Begin Transaction ....
Miscellaneous
Thread ID:
00673158
Message ID:
00673158
Views:
48
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
Next
Reply
Map
View

Click here to load this message in the networking platform