|
In order to simplify testing, I asked our java developer to create asimple
method to call from rpg that made no connections at all to thevariables
iSeries. I created an rpgle program to call the method. I have code
that adds a link to the directory, adds the .jar to the environmental
variable, uses getJniEnv and BegObjGroup (jniutil), calls the java
method (defined as a Static Extproc), ends the object group, removes
the environmental
and removes the link. When I then check the .jar file on the ifs theusage
is 'in use' under the job that I ran the rpg program in. I am unableconclusion
to restore that object or release it in any way until that session is
signed off.
Having said all that and testing past versions, I've come to the
that this was most likely the case for years on installs, we are justseeing
it more often as the use of java has become more prevalent. If have[mailto:java400-l-bounces@xxxxxxxxxxxx]
found nothing in my searches as a work around, unless anyone has any ideas.
Thanks
-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
On Behalf Of Dan Kimmelthe
Sent: Tuesday, November 02, 2010 10:36 AM
To: Java Programming on and around the IBM i
Subject: RE: .jar files in use on a restore
Are you talking about database connections or connections to run
native commands and programs?
JDBC connections use JT400.jar (JTOPEN.jar) and classes from the jre.
I doubt you're replacing any of those. What jars are failing to
replace? Are they your own code?
If you are using the non-thread-safe versions of the connection
commands, those connections occur in jni programs that run within the
same job as
jvm. The thread-safe versions are all native java and jdk codecommunicating
with server jobs that usually run in the QUSRWRK subsystem. That mightmake
a difference when trying to shut down the jvm via the activation group[mailto:java400-l-bounces@xxxxxxxxxxxx]
to free up connections to your jar files.
Just as an afterthought, are you doing anything to your java
environment that would free up hard links before you end the activiation group?
-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
On Behalf Of Anna Abtended
Sent: Tuesday, November 02, 2010 7:33 AM
To: 'Java Programming on and around the IBM i'
Subject: RE: .jar files in use on a restore
The activation group is ended at the end of the rpg processes and also
at the beginning of an install/upgrade. As this seems to be[mailto:java400-l-bounces@xxxxxxxxxxxx]
intermittent and a fairly new occurrence, I'm leaning toward something
the java code is doing in creating an iSeries connection. I am
running more tests on our systems to see if I can get more details.
-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
On Behalf Of Dan Kimmelyou're
Sent: Monday, November 01, 2010 6:06 PM
To: Java Programming on and around the IBM i
Subject: RE: .jar files in use on a restore
As long as that RPG program has pointers to the instantiated object,
not going to be able to replace the jars containing the code for thatto
object. There are other ways to do it, but you're probably going to
have
end the activation group where the RPG program is running in order toremove
the locks on the jar files. I don't think the traditional methods ofjar
detecting locks are going to find locks on your jar files. WRKOBJLCK,
for instance, looks for objects referenced by the job and a jar file
is not an object. However, the file is "in use".
When RPG uses a java method, RPG invokes the JVM and the JVM "opens"
the
files. The JVM doesn't need the jar file anymore after the class andobject
are instantiated in memory and might close it, except for garbagejob.
collection. The JVM must hold a lock on the jar file as long as it is
running as it might need to read the class from the jar again if
garbage collection has removed the class object when RPG needs to
build a new instance.
Depending on the operating system level, the jvm may run in a separate
In any case it is a unique thread or threads whether in the same jobthe
as
RPG or in its own job. All the stuff that connects the RPG to the jvmin
is
an activation group. If you have the RPG program running in someactivation
group outside the default activation group, the jvm-glue probably runsagain.
in the same activation group. If your RPG program is running in the
default activation group all that glue is probably in its own
activation group. I say probably here, because I'm reporting behavior
as I see it; I don't actually have documentation on this.
So my take on how to do the upgrade you describe would be to have the
CL that runs the RPG program end the activation group that contains
the RPG program; do the jar file replaces; then start the RPG program
back up
This should work in just about all operating systems and versions of java.[mailto:java400-l-bounces@xxxxxxxxxxxx]
Anyone else care to contribute?
-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
On Behalf Of Anna Abtand
Sent: Monday, November 01, 2010 4:07 PM
To: 'Java Programming on and around the IBM i'
Subject: RE: .jar files in use on a restore
There was no OS upgrade or PTF applied on our systems since the
problem started, I do not know about clients. We run v5r3, v5r4, and
v5r6 here
support back to v5r2 for our customer base. RPG invokes the jvm andrpg
sets the class path and environmental variables and begins and ends
the object group. RPG calls the methods within an instantiated
object. Before any upgrades locks on all rpg objects are checked and
the upgrade will not continue if it cannot allocate all objects. The
basic processing on the
side has been the same for a number of years. Some java methods were[mailto:java400-l-bounces@xxxxxxxxxxxx]
connecting to the iSeries for data retrieval.
-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
On Behalf Of Dan Kimmelmore
Sent: Monday, November 01, 2010 4:28 PM
To: Java Programming on and around the IBM i
Subject: RE: .jar files in use on a restore
I think the connection pool is a red herring. The problem probably has
to do with an OS upgrade or PTF applied in the last year. I'd need toa
know
lot more to offer any other suggestions. What OS version? What kind ofin
programs use the jar files? How is the jvm invoked? Where does the rpg
program enter the picture? Is the rpg program calling methods on
objects
the jar files? Do you stop all instances of the rpg program before[mailto:java400-l-bounces@xxxxxxxxxxxx]
attempting to replace the jar files?
-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
On Behalf Of Anna Abtstate.
Sent: Monday, November 01, 2010 2:38 PM
To: java400-l@xxxxxxxxxxxx
Subject: .jar files in use on a restore
Recently we have run into an issue when trying to run upgrades of our
software. I have a clle program that does a restore to an ifs
directory with new .jar files. There have been instances lately where
objects have not been restored because they are in use. Speaking with
our java programmers I did learn that there was a change made in the
past year to create a connection pool and keep it open for a longer
period of time for performance enhancing reasons. Doing some testing,
we removed the connection and are now sending the data from the rpg
programs to the java methods. We are still finding that the .jar files stay in a "in use"
Can anyone tell me how we might get around this or why this seems toof
be happening all of a sudden? We even did a simple test adding a
classpath
3 .jar files and running 2 programs, the first opens a connection andprints
and the second closes the connection. Those 3 files still are in usesignature
and unable to run a restore against.
--
This is the Java Programming on and around the IBM i (JAVA400-L)
mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/java400-l.
--
This is the Java Programming on and around the IBM i (JAVA400-L)
mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/java400-l.
__________ Information from ESET NOD32 Antivirus, version of virus
database 5583 (20101101) __________signature
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
--
This is the Java Programming on and around the IBM i (JAVA400-L)
mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/java400-l.
--
This is the Java Programming on and around the IBM i (JAVA400-L)
mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/java400-l.
__________ Information from ESET NOD32 Antivirus, version of virus
database 5584 (20101102) __________signature
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
--
This is the Java Programming on and around the IBM i (JAVA400-L)
mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/java400-l.
--
This is the Java Programming on and around the IBM i (JAVA400-L)
mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/java400-l.
__________ Information from ESET NOD32 Antivirus, version of virus
database 5585 (20101102) __________list
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
--
This is the Java Programming on and around the IBM i (JAVA400-L)
mailing
To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe,--
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/java400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.