Re-importing Your Java Code About Sharing Static Variables Across Multiple JVMs

10-6 Forms Services Deployment Guide Figure 10–3 Forms Runtime with JVM Pooling Enabled In this example, five clients working in the same application through their own runtime processes are using a pooled JVM process instead of each Forms Runtime process spawning its own JVM instance. This can be a significant savings in memory usage and system resources.

10.5 Design-time Considerations

This section contains the following: ■ Section 10.5.1, Re-importing Your Java Code ■ Section 10.5.2, About Sharing Static Variables Across Multiple JVMs

10.5.1 Re-importing Your Java Code

If you used the Java Importer feature of Oracle Forms prior to the availability of JVM Pooling, you will need to reimport your Java classes before using JVM pooling. When you originally imported your Java classes, PLSQL wrappers for the Java classes were generated, which you can see in the Program Units that were created in your Form. However, the PLSQL wrappers that are generated by the Java Importer to utilize JVM pooling are different. From Oracle Forms Services 10g and later, the Java Importer generates the new PLSQL wrappers. If you want to use the Java Importer, but do not wish to take advantage of JVM pooling, the in-process JVM will work with the new PLSQL wrappers. It will also continue to work with the older-style PLSQL wrappers.

10.5.2 About Sharing Static Variables Across Multiple JVMs

One advantage of JVM pooling is the ability to share data between instances of a class by using static variables. However, static variables will be shared between instances of the same class within a JVM, but not across JVMs. You will need to plan accordingly. For example, suppose your loan class has a static variable called interestRate because all instances use the same interest rate in calculations. If you are using only Application Server Forms Runtime Process Forms Runtime Process Forms Runtime Process Forms Runtime Process Forms Runtime Process JVM Client Client Client Client Client Configuring and Managing Java Virtual Machines 10-7 one JVM, and one of the instances of your loan class changes interestRate, all of the other instances will be affected which is what you want. However, if the JVM controller has one or more child JVMs, there may be at least two JVMs. If interestRate changes in one JVM, the loan instances in the other JVMs wont see this new value. For more information about managing child JVMs, see Section 10.2, About Child Java Virtual Machine Processes . Prior to JVM pooling, if you changed interestRate it would not affect any other instances because each Oracle Forms Runtime process had its own in-process JVM. If you rely on static variables to share information between instances of your class, ensure that no child JVM is spawned by setting maxsessions to 65535.

10.6 Overview of JVM Configuration