Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Again, troubles with CursorAdapter
Message
From
16/08/2003 05:34:12
 
 
To
16/08/2003 05:06:36
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00819734
Message ID:
00820721
Views:
50
Aleksey ????

It is very good you brought this up. I've double checked and it is actually not driver,
but VFP forces transaction to be committed before connection is closed.
This behavior goes back at least to VFP6 and most likely to the time when SPT was added to the product.

But you have aks to me this:

VFP never calls [set implicit_transactions on] and it never calls [IF @@TRANCOUNT > 0 COMMIT TRAN]. VFP doesn't target any specific backend. And as a good ODBC client it uses SetConnectOption(...,SQL_AUTOCOMMIT,..) and SQLTransact() functions to manage transactions. For VFP developers: SQLSETPROP(con,"Transactions",...) is mapped to SetConnectOption(...,SQL_AUTOCOMMIT,..), SQLCommit() is mapped to SQLTransact(...,....,SQL_COMMIT) and SQLRollback() is mapped When I say mapped, I mean that VFP forwards the call to ODBC and doesn't do anything else, ODBC driver decides what commands to call and when to call them.

If connection is closed while there is in an active transaction,
driver commits changes.
I'm returned to the departure point, is VFP that executes the commit or the driver?


Should the behavior be changed now?
yes

Not an easy question to answer.

Easy
If a developer use SQLSetProp(nConn, "Transactions", DB_MANUAL)
and SQLDISCONNEC(nConn) for commit changes, it is a mistaken.

Fabio
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform