Java
Object Cache (Distributed Java Caching) in Oracle E-Business Suite 11i/R12
If you are upgrading your system (or planning to upgrade) to ATG roll up 4, 5 or 6 or using R12 (12.0.X to 12.1.X); beware of below common intermittent issues around Web
Server (Apache/Jserv/OC4J/JVM) for 11.5.10 and R12
- Responsibility not visible to users
-NoCalssDef found error in JVM logs
-Intermittent hang in JVM (Jserv/Apache)
-Intermittent page not found while accessing/login apps ( 500 Internal Server Error)
Most (if not all) of these issues are around Distributed Java Cache feature of JVM in Oracle Apps 11i/R12, before going further let me ask you basic questions around Java Cache
Q. What is significance of wrapper.bin.parameters=-DLONG_RUNNING_JVM=FALSE in jserv.properties ?
Q. Why you need s_java_object_cache_port & s_fnd_cache_port_range in Context File ($SID_hostname.xml) ?
Q. What is $APPLRGF/javacache.log ?
Good starting point to understand Java Caching in 11i/R12 is to go through Mike Shaw’s
post here
(参考链接:)
Lets now understand basics of Java Object Cache (JOC) or
Distributed Java Cache which was introduced in apps from ATG RUP 3.
JVM – Java Virtual Machine : to execute Java Code in apps; JServ (for 11i) and OC4J (for R12) .
Caching in JVM: To improve performance, JVM’s cache data they extract from Database before passing it on to User(为了提高性能,JVM在将从数据库内提取的数据传给用户之前,自己先存放在自己的cache中).
Database Invalidation: This feature ensures that when the data in a database is updated, the corresponding cached data in the mid-tier is also updated. This is useful when the updates to the database bypass(绕过) the JVMS for example updates
through forms or sqlplus.
Distributed Java Caching: In a multiple JVM environment (multiple JVM on one or more middle tier or Single JVM on multiple Middle tier ),
Distributed caching allows one JVM to inform all the other JVMs about updates to any cached data. This ensures consistency of the cached data across all the JVMs.
The updates and invalidations of
the objects in a distributed Component Cache are propagated(传播) to all the other JVMs that are running against the same database..
How data synchronization and invalidations handled in Distributed Java caching : In multi JVM environment;
a) First JVM to come online acts as Master Cache Controller and rest other JVMs
as client JVMs .
b) Upon startup, each JVM auto-registers the host it is running on in the database ( table name JTF_PREFAB_WSH_POES_B).
c) The Master cache controller listens for cache invalidation in the port specified by s_java_object_cache_port(default
is 12345) and the client JVMs will open client ports taken from the range established by s_fnd_cache_port_range (when specified – Default not set).
d)When an object gets invalidated or replaced in the cache, then invalidation message is sent to all other JVMs via Master
Cache Controller.
If this Master JVM (acting as Master Cache Controller) dies gracefully or abnormally, then one of client JVM takes role of Master cache Controller (There are couple of Bugs around this issue)
.
Data Partition: This feature allows the cached data to be partitioned based on any partition keys. This is useful for JVMS in hosting environments running against a Virtual Private Database (VPD). The caching framework ensures that the cache
data is partitioned based on security group id.
.
How to disable distributed caching or enable local caching ?
Set s_long_running_jvm to false in context (xml) file and run autoconfig . <jms_cache oa_var=”s_long_running_jvm”>false</jms_cache>
This will update wrapper.bin.parameters=-DLONG_RUNNING_JVM to FALSE in jserv.properties
or
set wrapper.bin.parameters=-DCACHEMODE=LOCAL in jserv.properties (default is Distributed)
.
Checking Java Cache from front end
login to URL http://<machinename>:<port> /OA_HTML/jtflogin.jsp
sysadmin/<sysadmin_passwd> Performance -> Components
For Cloned Instances
Nodes registered for Java Caching and the cache configuration details are stoerd in table JTF_PREFAB_WSH_POES_B, its good idea to truncate
this table on cloned instance (If entry contains source instance nodes) and restart Apache to re-register target instance nodes in table JTF_PREFAB_WSH_POES_B
相关阅读:http://docs.oracle.com/cd/B25221_04/web.1013/b14427/joc.htm#sthref706