General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Why will TXNLEVEL() fail?
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
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only