Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Transactions and GetAutoincValue()
Message
 
To
13/01/2009 11:01:25
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01373138
Message ID:
01373384
Views:
24
>>Does GetAutoincValue() work ok with Transactions? My program does the following:
>>
>>
BEGIN TRANSACTION
>>Create an invoice header record
>>InvoiceKey = GetAutoincValue()
>>Create a set of invoice line records that include the Invoice Key from above.
>>If all ok
>>  END TRANSACTION
>>else
>>  ROLLBACK
>>endif
>>
>>Is there any problem here if a rollback is done? How does this affect any other users in the system running the same code at the same time?
>
>- The first user which insert a record lock the header table.
>- The first user which update a record lock the updated record
>- Regardless the END or ROOLBACK action the Autoinc value it is consumed

Thanks, I thought it would be ok but I wanted to check before I did it.
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn
Previous
Reply
Map
View

Click here to load this message in the networking platform