![]() |
![]() |
![]() |
![]() |
![]() |
Configure the following files just like you configure on Oracle Coherence. See Oracle Fusion Middleware Developing Applications with Oracle Coherence for detailed instruction.You can deploy the above configuration files into any path as long as this path is in the java class path and prior to where coherence.jar is. For example, you can put the configuration files into ${APPDIR}/config and then start Oracle Coherence server like this:Listing 2‑1 Oracle Coherence Cluster Deploymentjava -server -showversion $JAVA_OPTS -Dtangosol.coherence.mode=prod -cp $APPDIR/config: ${COHERENCE_HOME}/lib/coherence.jar com.tangosol.net.DefaultCacheServerListing 2‑2 is an example; note the properties in bold. In this example, coherence_tux is the name of the Oracle Coherence cluster whose multicast port number is 51697 and unicast port number is 51687.Listing 2‑2 tangosol-coherence-override.xmlListing 2‑3 is an example; note the properties in bold. In this example, we create an Oracle Coherence cache named tux_distributed.Listing 2‑3 coherence-cache-config.xmlOracle Tuxedo Caching Server Module runs in Tuxedo Java server, so TMJAVASVR must be configured in UBBCONFIG. TMJAVASVR uses multi-threaded configuration to improve performance. Multi-instances configuration is also used to gain higher availability.Listing 2‑4 UBBCONFIG for TMJAVASVRYou should configure this Oracle Tuxedo Caching Server Module in Oracle Tuxedo Java Server Configuration File; the package that Oracle Tuxedo Java server uses to enable TDC is com.oracle.tuxedo.tjtdc.jar located in ${TUXDIR}/udataobj/tuxj/tdc.Listing 2‑5 is an example of Oracle Tuxedo Java Server Configuration File that enables TDC. -f option of the <server-clopt> element is newly added for this feature and is used to specify the path of TDC property file. For more information of other elements and options, see "Java Server Configuration Schema File for version 2.0" in Setting Up An Oracle Tuxedo Application.
• In general, you should not change the code lines in bold. The class com.oracle.tuxedo.tdc.TCache4Coherence is the main class used by TDC which is located in ${TUXDIR}/udataobj/tuxj/tdc/com.oracle.tuxedo.tjtdc.jar .
• It is necessary to change the code lines in Italic due to different environment. Note that <APPDIR> must be replaced with the real path to make the file work.
• The class path ${APPDIR}/config</classpath> must be prior to the class path ${COHERENCE_HOME}/lib/coherence.jar.Listing 2‑5 Configuring Oracle Tuxedo Caching Server Module in Oracle Tuxedo Java Server Configuration FileIt is required to add a new property file which specifies all properties about the caches for TDC. Oracle Tuxedo Caching Server Module advertises services using the name of these caches. You can define many Oracle Tuxedo caches in a single property file. See Oracle Tuxedo Distributed Caching (TDC) Property File Properties for this file's properties.Listing 2‑6 shows a template of the property file. In this template, two Oracle Tuxedo cache names are configured: tc1 and tc2. tc1 uses Oracle Coherence cache tux_distributed and tc2 uses Oracle Coherence cache tux2_distributed.You can find this template in $TUXDIR/udataobj/tuxj/tdc/tdcsvr_coh.conf.template. You can change the name and the location of this property file; if so, make sure you make the same change for the <server-clopt> -f option in Oracle Tuxedo Java Server Configuration File (see Listing 2‑5 for an example).Listing 2‑6 TDC Property File TemplateA natural line is defined as a line of characters that is terminated either by a set of line terminator characters (\\n or \\r or \\r\\n) or by the end of the stream. A natural line may be either a blank line, a comment line, or hold all or some of a key-element pair.A natural line that contains only white space characters is considered blank and is ignored. A comment line has an ASCII '#' or '!' as its first non-white space character; the key contains all of the characters in the line starting with the first non-white space character and up to, but not including, the first unescaped '=', ':'. Any white space after the key is skipped; if the first non-white space character after the key is '=' or ':', then it is ignored and any white space characters after it are also skipped. All remaining characters on the line become part of the associated element string; if there are no remaining characters, the element is the empty string "".Table 2‑1 lists the supported TDC property file properties.
• yes (all caching data must be encoded)
• no (default)This value can be overridden by cache.options.encoding.[cachename]. yes indicates all caching data in Oracle Tuxedo cache [cachename] must be encoded. It should be enabled when caching users are located in machines that have different data representation.If this property is not set, options.encoding value is used. The value of yes indicates all caching requests will be logged into coherence log. It is set to no by default.
• [cachename] must be 78 characters or less in length. A service with name [cachename] will be advertised by Oracle Tuxedo Java Server.
• When you set options.logging=yes, the log level is 6 (and you cannot change this default value). Therefore, in Oracle Tuxedo Coherence configuration file, you should specify the element <severity-level> no less than 6 in order to print logging information.
Oracle Tuxedo Java Server introduces a new class called T_TJS, which is used for this feature. Using this, you can modify, add, and delete a TDC property. Note that, this dynamic configuration does not affect the cached data in Coherence; removing a cache mapping does not mean clearning the cached data.See Listing 2‑7 for an interface example.Listing 2‑7 Interface to configure TDC Property by TMIBWe use TA_TDC_PROPERTY attribute to set the property, and use TA_TDC_PRO_UPDATEMODE attribute to indicate the operation mode which can be set as delete, new, or modify. The value for TA_TDC_PROPERTY is key-value pair of TDC property when operation is new or modify, and is the key of TDC property when operation is delete. Note that, the separator for key-value pair only can be "=".See Listing 2‑8 for a sample to add properties to TDC property file (Run command: "ud32 -C tpsysadm<setProperty"); see Listing 2‑9 for a sample to delete properties from TDC property file.Listing 2‑8 Edit a ud32 Input File: setpropertyListing 2‑9 Delete Properties from TDC Property FileIf there is no Oracle Coherence Cluster is running, start your own cluster, making sure you configure the path of the configuration files into the Java Class Path and ahead of where coherence.jar is. See Listing 2‑1 for an example.See Configuring Oracle Tuxedo Caching Server Module for instruction.See Configuring Oracle Coherence for instruction.If there is no Oracle Coherence Cluster is running, start your own cluster, making sure you configure the path of the configuration files into the Java Class Path and ahead of where coherence.jar is. See Listing 2‑1 for an example.See Configuring Oracle Tuxedo Caching Server Module for instruction.Configure TDC Result Caching on UBBCONFIG. See Section 5 - File Formats, Data Descriptions, MIBs, and System Processes Reference for more information.Specify CACHING=string_value as the name of the caching criteria used for caching for this service.
• CACHING_CRITERIA_NAME required_parameters (Mandatory)
• CACHENAME=string_value (Mandatory)
•
• KEY_FIELD= "field1[+field2[+field3[+¡]]]" (Optional)Listing 2‑10 shows an example, where
• Svccache1 uses Oracle Tuxedo cache tc1. Other configurations are default. (It means KEY=$service+$request and KEY_BUFTYPE=STRING).
• Svccache2 uses Oracle Tuxedo cache tc1. The request is used to figure out the key when caching the response data. Other configurations are default. (It means KEY_BUFTYPE=STRING).
• Svccache3 uses Oracle Tuxedo cache tc1. The fixed string key1 is used as the key. Other configurations are default.
• Svccache4 uses Oracle Tuxedo cache tc1. The buffer type of the request message to the service is VIEW32 whose subtype is mystruct1. The value of the field name in the subtype mystruct1 is used as the key.
• Svccache5 uses Oracle Tuxedo cache tc1. The buffer types of the FML32 and VIEW32: mystruct1 have the same field1 and field2 (name and data type should be the same; value can be different); the request message will use the values of field1 and field2 as the key.Listing 2‑10 UBBCONFIG CACHING Section ConfigurationYou can use MIB to dynamically make changes for TDC Result Caching. The following sub-sections explain TDC Result Caching related MIB attributes. See Section 5 - File Formats, Data Descriptions, MIBs, and System Processes Reference for more information.
• T_SERVICE Class Definition
• T_CACHING Class Definition
• See Oracle Fusion Middleware Developing Applications with Oracle Coherence for more information.When an Oracle Tuxedo application server is shutdown, Oracle Tuxedo deletes all the services in the server. If one service does not exist in the whole Oracle Tuxedo application system, Oracle Tuxedo deletes all the cached data which is based on the caching entry of the service. Now, Oracle Tuxedo only supports the "tmshutdown -s servername" command to trigger this function.When shutdown Oracle Tuxedo Caching Server Module, Oracle Tuxedo tries to delete all the service cached data from all the caches which are configured in TDC property file, and tries to remove all the entries in cache with a key prefix tdc_svc_ (a prefix of the internal caching key).See Oracle Coherence documentation for instructions.
• <destination> element is used to configure path and file name for emitting log messages to a file. The specified path must already exist.
• Add ecid into < message-format > element to enable ECID.
• <severity-level> element can be used to change log level.Listing 2‑12 Enabling ECID for TDC