enquiring on transactions in 4gl
Posted in 1999
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Java & JDBC Development
Hi I have a large number of 4gl programs called from java using corba. I have a problem where a transaction is started and is lost before the commit work is reached. Is there any way of enquiring on the transaction status in 4gl Thanks for any help Ian Boyes
Ian Boyes wrote: > I have a large number of 4gl programs called from java using corba. > I have a problem where a transaction is started and is lost before > the commit work is reached. Is there any way of enquiring on the > transaction status in 4gl A year or more ago, I posted some SPL code to do this -- I happened to look at the file this morning, but at the office, not at home where I am answering your question. You'll need to verify what I'm about to suggest, therefore; it is working from memory, and is sketchy. To determine whether you are in a transaction at the moment, do: BEGIN WORK IF SQLCA.SQLCODE = -256 THEN ...TX not available... ELIF SQLCA.SQLCODE = -536 THEN ...Already in TX... ELIF SQLCA.SQLCODE = 0 THEN ...Were not in TX... ROLLBACK WORK ELSE ...Unknown Error... ENDIF Note that this is the safe way to deal with the problem. Trying COMMIT or ROLLBACK could lose data. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN #include <disclaimer.h>