2

I have a web service that calls some stored procedure on a AS400 via JTOpen.

What I would like to do is that the connections used to call the stored procedures was opened in a specific subsystem with a specific user, instead of qusrwrk/quser as now (default).

I think I can be able to clone the qusrwrk subsystem to make it start with a specific user, but what I cannot figure out is the mechanism to open the connection in the specific subsystem.

I guess there should be a property at connection level to say subsystem=MySubsystem.

But unfortunatly I haven't found that property.

Any hint would be appreciated.

Flavio

user1805879
  • 61
  • 1
  • 7
  • 1
    Why do you care about which subsystem? What is it that you wish to accomplish with that factor? User Profile and Password are easily specified, but work management is a different is a different set of issues. – WarrenT Nov 07 '12 at 12:07
  • when I start the connection, also if I specify my user, the as400 job is always started for default user quser. My main goal is to have the job started with my own user. I found some docs on IBM site, and it seems that the only way to change this behavior is to start my own subsystem ; there a can specify the default user I want. – user1805879 Nov 07 '12 at 13:28
  • 1
    The server job does a profile switch from QUSER to your user. In effect, it is already running under your user. – Buck Calabro Nov 07 '12 at 14:57
  • Well, what I see in the programs is that the user is retrieved from the program status data structure (SDS) and is always QUSER. No matter what user has opened the JDBC connection. To be honest, if I look at the active jobs list, I see under the QUSRWRK subsystem the job QZDASOINIT with current user as the open connection user. Well, maybe I can find both users (job and current) and I use the wrong one. In fact in the SDS there are 2 users : 254/263 User name from the user profile and 358/367 Current user profile name. I use the first, probably I need to use the second. – user1805879 Nov 07 '12 at 16:56
  • 1
    Use the current user name in the SDS ... although keep in mind, this won't be updated if your application switches user handles itself. – David G Nov 07 '12 at 22:20

2 Answers2

2

Let the system take care of the subsystem the job database server job is started in.

You should just focus on the application (which is what IBM i excels in).

If need be, you can tweak subsystem parameters for QUSRWRK to improve performance by allocating memory, etc.

David G
  • 3,940
  • 1
  • 22
  • 30
0

The system uses a pool of prestarted jobs as described in the FAQ: When I do WRKACTJOB, why is the host server job running under QUSER instead of the profile specified on the AS400 object?

To improve performance, the host server jobs are prestarted jobs running under QUSER. When the Toolbox connects to a host server job in order to perform an API call, run a command, etc, a request is sent from the Toolbox to an available prestarted job. This request includes the user profile specified on the AS400 object that represents the connection. The host server job receives the request and swaps to the specified user profile before it runs the request. The host server itself originally runs under the QUSER profile, so output from the WRKACTJOB command will show the job as being owned by QUSER. However, the job is in fact running under the profile specified on the request. To determine what profile is being used for any given host server job, you can do one of three things:

1. Display the job log for that job and find the message indicating which user profile is used as a result of the swap.
2. Work with the job and display job status attributes to view the current user profile.
3. Use Navigator for i to view all of the server jobs, which will list the current user of each job. You can also use Navigator for i to look at the server jobs being used by a particular user.
James Allman
  • 40,573
  • 11
  • 57
  • 70