I am in a transaction ?? (I4GL)
Posted in 2009
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Hi peps! There is any way inside Informix-4GL to know if the session has an active transaction ? Plain Old Informix 4GL 7.32.UC4 If the language doesnt provide, can query SMI ? Where is it in SMI ??? sysmaster:syssessions, sysmaster:syssesprof, sysmaster:syssqlstat ????? cant find it... THANKS
eferreyra wrote: > Hi peps! > > There is any way inside Informix-4GL to know if the session has an > active transaction ? > > Plain Old Informix 4GL 7.32.UC4 I think it's somewhere in SQLCA. -- Cheers, Obnoxio The Clown http://obotheclown.blogspot.com -- This message has been scanned for viruses and dangerous content by OpenProtect(http://www.openprotect.com), and is believed to be clean.
There's no easy way to tell, certainly not for another session. From within a session you can BEGIN WORK and check the sqlca.sqlcode. If your session was already within a transaction you will get an error -535 "Already in a transaction!" If sqlca.sqlcode returns zero (0) then rollback the dummy transaction and note your state as Not in a Transaction. I'm sure that it's in the SMI tables somewhere but I haven't found it. Art Art S. Kagel Oninit (www.oninit.com) IIUG Board of Directors (art@iiug.org) Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Oninit, the IIUG, nor any other organization with which I am associated either explicitly or implicitly. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Tue, May 19, 2009 at 9:27 AM, eferreyra <eferreyra@gmail.com> wrote: > Hi peps! > > There is any way inside Informix-4GL to know if the session has an > active transaction ? > > Plain Old Informix 4GL 7.32.UC4 > > If the language doesnt provide, can query SMI ? > > Where is it in SMI ??? > sysmaster:syssessions, sysmaster:syssesprof, > sysmaster:syssqlstat ????? > > cant find it... > > THANKS > > _______________________________________________ > Informix-list mailing list > Informix-list@iiug.org > http://www.iiug.org/mailman/listinfo/informix-list >
ok, thanks. On 19 mayo, 13:13, Art Kagel <art.ka...@gmail.com> wrote: > There's no easy way to tell, certainly not for another session. From within > a session you can BEGIN WORK and check the sqlca.sqlcode. If your session > was already within a transaction you will get an error -535 "Already in a > transaction!" If sqlca.sqlcode returns zero (0) then rollback the dummy > transaction and note your state as Not in a Transaction. > > I'm sure that it's in the SMI tables somewhere but I haven't found it. > > Art > > Art S. Kagel > Oninit (www.oninit.com) > IIUG Board of Directors (a...@iiug.org) > > Disclaimer: Please keep in mind that my own opinions are my own opinions and > do not reflect on my employer, Oninit, the IIUG, nor any other organization > with which I am associated either explicitly or implicitly. Neither do > those opinions reflect those of other individuals affiliated with any entity > with which I am affiliated nor those of the entities themselves. > > On Tue, May 19, 2009 at 9:27 AM, eferreyra <eferre...@gmail.com> wrote: > > Hi peps! > > > There is any way inside Informix-4GL to know if the session has an > > active transaction ? > > > Plain Old Informix 4GL 7.32.UC4 > > > If the language doesnt provide, can query SMI ? > > > Where is it in SMI ??? > > sysmaster:syssessions, sysmaster:syssesprof, > > sysmaster:syssqlstat ????? > > > cant find it... > > > THANKS > > > _______________________________________________ > > Informix-list mailing list > > Informix-l...@iiug.org > >http://www.iiug.org/mailman/listinfo/informix-list
Probably the best way to do this is to just create some functions and log the transaction state in those - something like : define lv_state char(1) function begin_work() begin work let lv_state="Y" end function function commit_work() commit work let lv_state="N" end function function rollback_work() rollback work let lv_state="N" end function function get_state() if lv_state="Y" then return TRUE else return FALSE end if end function On Tuesday 19 May 2009 14:27:26 eferreyra wrote: > Hi peps! > > There is any way inside Informix-4GL to know if the session has an > active transaction ? > > Plain Old Informix 4GL 7.32.UC4 > > If the language doesnt provide, can query SMI ? > > Where is it in SMI ??? > sysmaster:syssessions, sysmaster:syssesprof, > sysmaster:syssqlstat ????? > > cant find it... > > THANKS > > _______________________________________________ > Informix-list mailing list > Informix-list@iiug.org > http://www.iiug.org/mailman/listinfo/informix-list -- Mike Aubury http://www.aubit.com/ Aubit Computing Ltd is registered in England and Wales, Number: 3112827 Registered Address : Clayton House,59 Piccadilly,Manchester,M1 2AQ