ESQL/C transaction
Posted in 1993
I have multiple libraries of ESQL-C functions. A lot of them call one another. Some functions also have begin/rollback/commit transactions. Problem I face is before starting transaction, how can I detect that a transaction has already been started ?? Multiple "begin work"s obviously (and correctly) is unsuccessful and returns error. e.g. foo1() { $begin work; if (foo2() < 0) $rollback work; if (foo3() < 0) $rollback work; $commit work; } foo2() { $begin work; /****** ERROR ******/ $delete from xxxxx if (sqlca.sqlcode) { $rollback work; return (sqlca.sqlcode); } $insert into xxxxx if (sqlca.sqlcode) { $rollback work; return (sqlca.sqlcode); } $commit work; return(0); } I simply cannot eliminate begin/roolback/commit from foo2 because there are other routines which call foo2 which have NOT started the transaction. Any help/suggestions/tips/flame/support welcome ! ======================================================================== Informix-OnLine 4.00.UD5 SCO 3.2 Informix-Isql 4.00 AST 486/33 Informix-Esql/C 4.00 Wingz 1.10 Bharat Shah Voice: (508)-663-7570 Unifi Communications Corp. Fax: (508)-663-7543 4 Federal St, Billerica, Mass 01821, USA uunet!bharat@unifi.com ========================================================================