Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Why will TXNLEVEL() fail?
Versions des environnements
I have code to update multiple tables (parent/child) wrapped in a transaction. During the transaction I have code to report errors to an error log when a tableupdate fails (and which table) before I rollback the transaction.
As a precaution, I wrap the open table code with a check for transaction level (IF TXNLEVEL() > 0) to use a different open routine since my general one sets buffering which is a no/no in a transaction.
Problem: I still get an error message "cannot set buffering within a transaction" which means that TXNLEVEL() is reporting NO transaction in progress yet VFP thinks/knows there is a transaction in progress. I guess I could code to always use the alternative open table (USE errorlog IN 0) but I really hate to loose all the error checking and processing that is inherrent in the framework open table routine. So what I really want to know is why TXNLEVEL() would report "0" when in a transaction so I can code around this "problem"
Thanks for any suggestions,
Steve
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement