Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Begin transaction & sqlsetprop(handle,transactions,2)
Message
From
27/02/2004 11:56:56
 
 
To
24/02/2004 13:08:10
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00880173
Message ID:
00881535
Views:
21
Hello,

'set a status into the Client ODBC driver,
and this send a implicit BEGIN TRANS to the backend.
The COMMIT remove 1 to the remote transaction level count,
but not change the status into the Client ODBC driver.'

thanx for stating this .., didn't know that it would "corrupt" the ODBC driver state..

taking this into consideration .. would this be the correct function sequence to make a transaction on a SQL-Server?



IF SQLSETPROP(lnConnection,[Transactions],2) != 1 && starts transaction
return someError
ENDIF

BEGIN TRANSACTION
&& also start transaction on local Cursoradapter's so they could be
&& rolled back if neccessary

..
make some updates
..

&& and if all updates/inserts returned .T.
&& try to commit them

IF SQLCOMMIT(lnConnection) = 1
END TRANSACTION && also commit local changes
ELSE
SQLROLLBACK(lnConnection)
ROLLBACK
ENDIF

&& and finally change the transactionmode to automatic again ..
SQLSETPROP(lnConnection,[Transactions],1)

????

i really would appreciate your comments .. since you seem to have deep knowledge in the field of transactionmanagement and not only this, since i read much of your 'bugreports' :-) here on the UT that state that you often know much about 'internal workings' of VFP code

Regards

Christian
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform