RE: Method to determine if in a transaction?
Posted in 2006
John Miller provided a simple C UDR to return the transaction state: ===============SOURCE CODE FOR trans.c====================== #include "incl/public/milib.h" mi_integer istransaction() { return (mi_transaction_state() == MI_NO_XACT ? 0 : 1 ); } =============== This would be an easy option for DBINFO or something similar, I would think, and a useful extension for SPL. You may add this to the feature request list under my name and company, if you like. The handy thing about SPL as opposed to C UDR's is that it does not have to be recompiled if your application is on multiple platforms. Even if the code is as simple as John's, it has to be source-controlled, compiled, and tested on each platform. I was having a discussion with someone off-group who did not think this was worth asking for because we all have access to examples of how to find this in SPL with a simple error handler. (Search for txstate.spl in http://www.iiug.org/software/archive/spl_jl_20021010 for example.) On the other hand, try explaining to a newbie why this is necessary, especially when the database server knows whether or not the thread is in a transaction. Sincerely, Christopher Coleman Steering Committee President Kansas City Informix Users Group www.iiug.org/kciug Database Analyst Pharmacy Division Mediware Information Systems, Inc.