Commitment control in SQLRPGLE

425 pts.
IBM iSeries
iSeries Commands
RPG Commit
Hi All

As we know that using COMMIT keyword at file level, to acheive commitment control, however I would like to know how to acheive commitment control using SQLRPGLE with out defining the COMMIT.

Software/Hardware used:

Answer Wiki

Thanks. We'll let you know when a new response is added.

Since your using SQLRPGLE

Commitment control of the Sql processes
is based on the Sql commit value.
You can set this value by issuing the SqL command
set option commit xxx

with xxx being one of these values

Of couse the files must be journaled
The sql command COMMIT or ROLLBACK should be issued to complete the process.

No F specs and no F spec COMMIT and no need for a STRCMTCTL command.


Discuss This Question: 5  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TomLiotta
    You might want to investigate the CRTSQLRPGI command COMMIT() parameter (or any CRTSQLxxx command). It may determine if/how commitment control is applied at either the *MODULE or the *PGM object level. Tom
    125,585 pointsBadges:
  • MurrayInfoSys
    Commit control can be implemented 2 ways. As Tom suggested or within the RPG program Itself. When compiling a program: CRTSQLRPG COMMIT(*HLP) Commitment control . . . . . . . > *HLP *CHG *ALL *CS *NONE *RR *UR *RS *NC Within the RPG program: You can use the "SET" statement within the RPG SQL program: Specify SET TRANSACTION Statement Type choices, press Enter. ISOLATION LEVEL . . . . . . . . 1=NO COMMIT (NC, NONE) 2=READ UNCOMMITTED (UR, CHG) 3=READ COMMITTED (CS) 4=REPEATABLE READ (RS, ALL) 5=SERIALIZABLE (RR) WARNING: Journaling must be active. Be aware of the processing overhead. Be aware of other users if this is an active file.
    940 pointsBadges:
  • Kar
    Thanks for the information, how can I check if any error on update/write... so that I want to execute some code
    425 pointsBadges:
  • TomLiotta
    how can I check if any error on update/write… Using what language? And running under what operating system version/release? Using RPG IV on current releases, you might code this way:
        monitor ;
           update MYFILE ;
        on-error 01221 ;
           callp  MyErrProc( 1 ) ;
        on-error *FILE ;
           callp  MyErrProc( 2 ) ;
        on-error *PROGRAM ;
           callp  MyErrProc( 3 ) ;
        on-error *ALL ;
           callp  MyErrProc( 4 ) ;
        endmon ;
    That piece of code attempts to run an UPDATE against a file named MYFILE. It monitors for errors in the UPDATE and calls procedures for different possible error conditions. The error handling doesn't have to be a CALLP -- it can be EXSR, CALL or any series of statements that you want. I showed CALLP for each one with a different parm for different errors. The first error tested is for file status code 1221, which is "UPDATE before prior READ". You can have different ON-ERROR sections for any error status codes that you want to handle. In order to show more details, I included the three 'generic' ON-ERROR conditions -- *FILE, *PROGRAM and *ALL. Any file status codes that are errors would be handled by the *FILE section. Any status codes that are errors but aren't file status codes would be handled by the *PROGRAM section. The ON-ERROR *ALL section could be used if you didn't have a *FILE and a *PROGRAM section. But other languages and versions would do things differently. Even RPG IV has other ways of doing it. Tom
    125,585 pointsBadges:
  • philpl1jb
    Were you trying to trap errors in native code Update and Write or Embedded SQL Update and Insert commands? Phil
    54,090 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: