Skip to content

Add setSqlServerMode as a utility procedure #105

@m1h43l

Description

@m1h43l

When a web service uses SQL transactions it needs to scope these to the thread and not the job or activation group. The could be done with the Change Job API. It would be great if we could add that to the ILEastic API.

The RPG code may look like this:

dcl-proc il_setSqlServerMode;
  dcl-pr sys_changeJob extpgm('QWTCHGJB');
    job char(26) const;
    internalJobId char(16) const;
    format char(8) const;
    jobChangeInfo char(1000) const options(*varsize);
    errorCode likeds(qusec);
  end-pr;

  dcl-ds jobc0200 qualified template;
    numberKeys int(10) inz(1);
    fieldInfoLength int(10) inz(20);
    keyField int(10) inz(1922);
    dataType char(1) inz('C');
    reserved2 char(3);
    lengthData int(10) inz(1);
    data char(1) inz('1');
    reserved3 char(3);
  end-ds;


  dcl-ds error likeds(qusec) inz;
  dcl-ds jobData likeds(jobc0200) inz(*likeds);

  sys_changeJob('*' : '' : 'JOBC0200' : jobData : error);
end-proc;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions