3.3.5 Deleting and resetting the schema cache
For deleting or changing schema documents to be cached, you must use commands to delete or reset up the cache. You can use the commands to apply the changes of the schema document in the cache without stopping the J2EE server.
For details about the precautions to be taken when deleting and resetting up the cache, see the subsection 6.18.4 Precautions related to reset up and deletion of a cache.
This subsection describes the commands to be executed while deleting and resetting up the cache:
- Organization of this subsection
(1) cacheoff command (deleting cache with XML parser)
(a) Format
cacheoff J2EE server name
(b) Operation while executing the cacheoff command
The following are the operations when using the cacheoff command. Note that if the schema cache functionality is disabled, no operation will be performed even when using the cacheoff command.
-
When you execute the cacheoff command, the XML parser releases all the cache from the memory, and deletes the directories having the same name as the J2EE server in the directory specified in diskcache_path of the schema definition file, and all the disk cache created below the directory.
-
The schema cache functionality is disabled after the cacheoff command is executed, and the XML parser executes the schema validation without using the cache.
-
The cacheoff command instructs the deletion of the cache in the XML parser, but does not directly delete the cache. The cache is deleted, when the DOM parse is passed for the first time, after the cacheoff command is executed.
-
When using the cacheoff command, the directory "directory or server name specified in diskcache_path" is displayed, and the user is requested to confirm the deletion. Even when the cache is not created on the disk, and only the directory to save the disk cache is to be created, the user will be requested to confirm the deletion.
-
An error message (KECX09506-E) is output in the standard error output, when using the cacheoff command, and an internal directory and the internal files are not accessible due to the abnormalities in the system, and the command process is interrupted.
-
The error message (KECX09510-E) is output, when you specify the J2EE server name that does not exist in the argument of the cacheoff command.
-
The error message (KECX09510-E) is output when ON is not specified in the com.cosminexus.jaxp.grammar_caching.preload property of the user-defined file of the J2EE server, and the cacheoff command is used for the J2EE server.
-
When there is a mistake in the argument of the command, the following error message is output and the process is interrupted:
KECX09513-E cacheoff : Invalid parameter. usage : cacheoff J2EE_server_name
(2) cacheon command (cache resetting with XML parser)
(a) Format
cacheon J2EE server name
(b) Operation when executing the cacheon command
The following are the operations, when using the cacheon command:
-
When using the cacheon command, the XML parser releases the cache from the memory and deletes the directories having the name same as that of the J2EE server in the directory specified in diskcache_path of the schema definition file, and all the disk cache created below the directory. Consequently, the cache is set up again according to the contents of the schema definition file.
-
The schema cache functionality is enabled after using the cacheon command, and the XML parser executes the schema validation using the cache.
-
The cacheon command instructs the reset up of cache with the XML parser, but does not directly delete or reset up the cache. The cache is deleted or reset up when the XML parse is passed for the first time, after using the cacheon command.
-
When using the cacheon command, an internal directory and the internal files are not accessible because of the abnormalities in the system, the error message (KECX09506-E) is output in the standard error output, and the command process is interrupted.
-
When you specify the J2EE server name that does not exist in the argument of the cacheon command, the error message (KECX09510-E) is output.
-
When ON is not specified in the com.cosminexus.jaxp.grammar_caching.preload property of the user-defined file of the J2EE server, and the cacheon command is executed for that J2EE server, the error message (KECX09510-E) is output.
-
When there is a mistake in the argument of the command, the following error message is output and the process is interrupted:
KECX09513-E cacheon : Invalid parameter. usage : cacheon J2EE_server_name
(3) cachestate command (display the cache functionality status)
(a) Format
cachestate [-d] [J2EE server name]
(b) Operation when executing the cachestate command
The following are the operations when using the cachestate command:
-
If the cachestate command is executed without the -d option, the status of the schema cache functionality is output in the standard output. The following table describes the displayed contents:
Table 3‒5: Status of the schema cache functionality to be displayed No.
Status of schema cache functionality
Content displayed
1
Enabled
"KECX09501-I J2EE Server 'J2EE server name': schema cache: ON"
2
Disabled
"KECX09501-I J2EE Server 'J2EE server name': schema cache: OFF"
-
When the cachestate command is executed, and an internal directory and internal files are not accessible because of the abnormalities in the system, the error message (KECX09506-E) is output in the standard error output, and the command process is interrupted.
-
When you specify a J2EE server name that does not exist in the argument of the cachestate command, the error message (KECX09510-E) is output.
-
When J2EE server name of the argument of the cachestate command is omitted, the information of all the J2EE servers is output.
-
In the user-defined file of the J2EE server, information is output, if ON is not specified in the com.cosminexus.jaxp.grammar_caching.preload property, no information will be output, even when you specify the -d option in the cachestate command and execute the command.
-
When there is a mistake in the argument of the command, the following error message is output, and the process is interrupted:
KECX09513-E cachestate : Invalid parameter. usage : cachestate [-d] [J2EE_server_name]
-
If the -d option is specified in the cachestate command and the command is executed, the following information is displayed in the standard output:
-
Schema cache functionality status (ON or OFF)
-
The current valid schema definition file
-
The current valid diskcache_path (directory where the disk cache is created)
-
Start and end time of the cache setup
-
Cache setup status of the schema document
-
Error information during the cache setup
The following figure shows the output format of the information.
Figure 3‒3: Output format when executing the cachestate command When you do not specify the server name, only the information about the number of servers will output. Even if the error KECX09506-E occurs during the execution, the information of the remaining servers will output. The content of this information is cleared whenever the cache is reset and updated.
-
(4) Relation of the synchronous processing of each command and parsing
The following table describes the relation of the synchronous processing of the cacheon command, cacheoff command, cachestate command, and the parsing.
No. |
Action to be executed |
System status |
||
---|---|---|---|---|
Other than when parsing and the cases mentioned at the right side |
When setting up cache |
When deleting cache |
||
1 |
Parsing |
Start parsing (start the process immediately). |
Start parsing after the setup is complete. |
Start parsing after completing the deletion. |
2 |
cacheon command |
Executed in the following order:
|
||
3 |
cacheoff command |
Execute in the following order:
|
||
4 |
cachestate command |
Display the following information:
|
"KECX09501-I J2EE Server 'J2EE server name': schema cache: displays OFF". |