Skip to Main Content
IBM Power Ideas Portal


This portal is to open public enhancement requests against IBM Power Systems products, including IBM i. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).


Shape the future of IBM!

We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:

Search existing ideas

Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,

Post your ideas
  1. Post an idea.

  2. Get feedback from the IBM team and other customers to refine your idea.

  3. Follow the idea through the IBM Ideas process.


Specific links you will want to bookmark for future use

Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.

IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.

ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.

Status Delivered
Workspace IBM i
Categories Db2 for i
Created by Guest
Created on Mar 1, 2019

User Java coexist with Java stored procedures

Presently Java stored procedures are mutually-exclusive with other Java code (for ref see https://www-01.ibm.com/support/docview.wss?uid=nas8N1021863).

We make extensive use of Java, so that means that the IBM-supplied Java stored procedures are inaccessible to us. The stored procedures include functions for Base64 encoding and the HTTP clients. The technote says the work-around is to use server mode. That's problematic to retrofit when you already have a large amount of SQL I/O. Server mode also prevents access to the job's QTEMP.

There are two possible scenarios for Java stored procedures to interact with other Java code.
1. I set the CLASSPATH, and the Java stored procedure starts the JVM, ignoring my CLASSPATH. The Java stored procedure runs normally, and my Java code fails later.
2. I set the CLASSPATH, and my Java code starts the JVM. My code is successful, any subsequent Java stored procedure will fail.

It seems reasonable to allow Java stored procedures to respect the user CLASSPATH. When a Java stored procedure starts the JVM, it currently ignores the user CLASSPATH and sets an arbitrary CLASSPATH. Why not simply append the user CLASSPATH to the end of the arbitrary one? If Java stored procedures have CLASSPATH requirements, those could be published so users can include that in their CLASSPATH.

Going forward, having Java stored procedures respect the CLASSPATH would allow both scenarios from above to be successful.
1. I set the CLASSPATH, and the Java stored procedure starts the JVM, appending my CLASSPATH. The Java stored procedure runs normally, and my Java code succeeds later.
2. I set the CLASSPATH (including the Java stored procedure requirements), and my Java code starts the JVM. My code is successful, and any subsequent Java stored procedure will complete normally.


Use Case:

In this particular case, I was attempting to return quote information back to the calling system. I also need to make calls out to Google API's.


Idea priority Medium
  • Guest
    Reply
    |
    Sep 11, 2021

    IBM believes a solution has been provided with IBM i 7.4 SF99704 Level 15 and IBM i 7.3 SF99703 Level 26.

    An alternate version of the HTTP functions that do not use Java have been implemented in the QSYS2 library.
    See this wiki page to access the complete details: https://www.ibm.com/support/pages/node/6486889

  • Guest
    Reply
    |
    Nov 12, 2020

    IBM recognizes the value of this request. We will use this request as input to planning but no commitment is made or implied. This request will be updated in the future if IBM implements it.

  • Guest
    Reply
    |
    Jul 17, 2020

    Mark, I don't think it would be upward compatible to associate the first JVM with the *DFTACTGRP. Even if the first JVM was the one started for the OS, RPG programs running in the default activation group due to ACTGRP(*CALLER) might need to use Java in the default AG. And even if it were possible to scope JVMs with a particular AG, it wouldn't work for an application that uses Java from multiple AGs.

  • Guest
    Reply
    |
    Jul 12, 2019

    This should have a much higher priority, as it potentially impacts many customers. If I BM is going to start using Java "all over the place", within the OS, then this issue becomes rather important.

    IBM really needs to "fix" this properly. IBM should enhance the operating system so that it is possible, (at least for IBM-supplied functionality), to start its own JVM inside the same job that has already started another JVM.

    A precedent for this is the concept of ILE activation groups. Perhaps it would be good if IBM could "scope" each JVM to an ILE activation group. That way, when you create a JVM, it is "attached to" or associated with the current activation group. Then, it becomes possible to have multiple JVMs, with different ones associated with each activation group. When RCLACTGRP is issued, or at end-of-job, those JVMs get "cleaned up."

    The current behavior (one JVM per job) can be "emulated" in an upwards-compatible manner by associating the first JVM created in a job with the *DFTACTGRP.