Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Bharat Shah — — source: Informix-list mailing list archive (1991-1998)
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
========================================================================
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.