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.
Roger asked what changes are needed in an Informix 4GL application after converting a database from unlogged to logged, and reported a "DECLARE CURSOR ... FOR UPDATE" error (later clarified as a run-time, not compile-time, error). Responses listed the required adjustments: update cursors and LOCK TABLE must be used inside an explicit transaction (no UNLOCK TABLE — just end the transaction), add BEGIN WORK/COMMIT WORK/ROLLBACK WORK around related statements with error trapping, expect more locking errors, avoid long transactions, and note the default isolation level changes from dirty read to committed read. One suggestion was to check sqlca.sqlwarn after opening the database to decide whether to use transactions. No confirmation from the poster that the issue was fixed is recorded.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
To change non-logged database to logged database.
Anything I need to change in 4gl program ?
↪ replying to roger
Fernando Nunes — — source: Usenet: comp.databases.informix
Probably yes. There are certain things you must do differently or that you
can't do... I should have a list somewhere but for now:
- lock table must be inside a transaction
- there is no "unlock table". Simply close the transaction
- you may get (more) locking errors and the programs should be able to
handle that
- you should prevent long transactions which may force you to split large
operations
- ...
On Aug 9, 2012 8:35 AM, "roger" <roger%star2000.com.tw@gtempaccount.com>
wrote:
> To change non-logged database to logged database.
>
> Anything I need to change in 4gl program ?
> _______________________________________________
> Informix-list mailing list
> Informix-list@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
>
...In the (missing) context of a discussion about what changes are needed
in an I4GL program when you switch between an unlogged database and a
logged database...
On Thu, Aug 9, 2012 at 3:09 AM, roger <
roger%star2000.com.tw@gtempaccount.com> wrote:
> I try compile 4gl program and got error
> if program contain " DECLARE CURSOR ... FOR UPDATE".
>
You need to provide more context. Is it a compile-time or a run-time error?
You have to be in a transaction, I think, to open a cursor FOR UPDATE with
a logged database. However, the system can only detect whether there is a
transaction active at run-time, not at compile-time.
--
Jonathan Leffler <jonathan.leffler@gmail.com> #include <disclaimer.h>
Guardian of DBD::Informix - v2011.0612 - http://dbi.perl.org
"Blessed are we who can laugh at ourselves, for we shall never cease to be
amused."
On Thursday, August 9, 2012 9:34:02 AM UTC+2, roger wrote:
> To change non-logged database to logged database. Anything I need to change in 4gl program ?
If I remember correctly, the default isolation level is different between a non logged database and a logged database (dirty read v commited read)
Depending how your application currently sets the isolation level, you may need to make some modifications to your application to accomodate this change in behaviour.
↪ replying to scottishpoet
Art Kagel — — source: Usenet: comp.databases.informix
The OP needs to add support for atomic transactions to his 4GL apps. That
means surrounding sets of related SQL statements that should be executed as
a complete transaction with BEGIN WORK; ... COMMIT WORK; statements and
trapping errors and issuing a ROLLBACK WORK; statement when they happen. I
would also detect whether the database supports transactions (see the
sqlca.sqlwarn structure immediately after opening the database to see the
logging status of the database) and use transactions or not as appropriate.
Art
Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
Blog: http://informix-myview.blogspot.com/
Disclaimer: Please keep in mind that my own opinions are my own opinions
and do not reflect on my employer, Advanced DataTools, the IIUG, nor any
other organization with which I am associated either explicitly,
implicitly, or by inference. 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 Thu, Aug 9, 2012 at 8:59 AM, scottishpoet <dryburghj@yahoo.com> wrote:
> On Thursday, August 9, 2012 9:34:02 AM UTC+2, roger wrote:
> > To change non-logged database to logged database. Anything I need to
> change in 4gl program ?
>
> If I remember correctly, the default isolation level is different between
> a non logged database and a logged database (dirty read v commited read)
>
> Depending how your application currently sets the isolation level, you may
> need to make some modifications to your application to accomodate this
> change in behaviour.
>
> _______________________________________________
> Informix-list mailing list
> Informix-list@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
>
On 8月9日, 下午7時42分, Jonathan Leffler <jonathan.leff...@gmail.com> wrote:
> ...In the (missing) context of a discussion about what changes are needed
> in an I4GL program when you switch between an unlogged database and a
> logged database...
>
> On Thu, Aug 9, 2012 at 3:09 AM, roger <
>
> roger%star2000.com...@gtempaccount.com> wrote:
> > I try compile 4gl program and got error
> > if program contain " DECLARE CURSOR ... FOR UPDATE".
>
> You need to provide more context. Is it a compile-time or a run-time error?
>
> You have to be in a transaction, I think, to open a cursor FOR UPDATE with
> a logged database. However, the system can only detect whether there is a
> transaction active at run-time, not at compile-time.
>
> --
> Jonathan Leffler <jonathan.leff...@gmail.com> #include <disclaimer.h>
> Guardian of DBD::Informix - v2011.0612 -http://dbi.perl.org
> "Blessed are we who can laugh at ourselves, for we shall never cease to be
> amused."
Sorry, It is run-time error !
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.