Oracle® TopLink Developer's Guide 10g Release 3 (10.1.3.1.0) Part Number B28218-01 |
|
|
View PDF |
This chapter describes how to configure a TopLink coordinated cache.
Table 88-1 Configuring TopLink Coordinated Caches
Table 88-1 lists the configurable options shared by two or more TopLink coordinated cache types.
For more information, see "Understanding Cache Coordination".
Table 88-1 lists the configurable options shared by two or more TopLink coordinated cache types. In addition to the configurable options described here, you must also configure the options described for the specific Coordinated Cache Types, as shown in Table 88-2.
Table 88-2 Common Coordinated Cache Options
Option | Type | TopLink Workbench |
Java |
---|---|---|---|
"Configuring Cache Coordination Change Propagation at the Descriptor Level" |
Basic |
||
"Configuring the Synchronous Change Propagation Mode" |
Basic |
||
"Configuring a Service Channel" |
Basic |
||
"Configuring a Multicast Group Address" |
Basic |
||
"Configuring a Multicast Port" |
Basic |
||
"Configuring a Naming Service Type" |
Basic |
||
"Configuring an Announcement Delay" |
Basic |
||
"Configuring Connection Handling" |
Advanced |
||
"Configuring Context Properties" |
Advanced |
||
"Configuring a Packet Time-to-Live" |
Advanced |
You can configure whether the coordinated cache should propagate object changes asynchronously or synchronously.
Table 88-3 summarizes which coordinated caches support propagation mode configuration.
Table 88-3 Coordinated Cache Support for Propagation Mode Configuration
Coordinated Cache | Using TopLink Workbench |
Using Java |
---|---|---|
JMS Coordinated Cache (asynchronous only) |
|
|
RMI Coordinated Cache |
|
|
CORBA Coordinated Cache |
|
|
Custom Coordinated Cache |
|
|
Synchronous propagation mode forces the session to wait for an acknowledgement before sending the next object change notification: this reduces the likelihood of stale data at the expense of performance.
Asynchronous propagation mode allows the session to create separate threads to propagate changes to remote servers. TopLink returns control to the client immediately after the local commit operation, whether or not the changes merge successfully on the remote servers. This offers superior performance for applications that are somewhat tolerant of stale data.
For more information, "Handling Stale Data".
To specify the change propagation mode, use this procedure:
Select a session or session broker in the Navigator. Its properties appear in the Editor.
Click the Cache Coordination tab. The Cache Coordination tab appears.
Ensure the Enable Cache Coordination option is selected, then select the appropriate coordinated cache Type (see Table 88-3). The cache coordination options appear on the tab.
Figure 88-1 Cache Coordination Tab, Synchronous Field
Select the Synchronous option to use synchronous change propagation. Do not select this option to use asynchronous change propagation.
The service channel is the name of the TopLink coordinated cache channel to which sessions subscribe in order to participate in the same coordinated cache. Such sessions use the service channel to exchange messages with each other. Messages sent on other service channels will not be exchanged with this coordinated cache.
Table 88-4 summarizes which coordinated caches support service channel configuration.
Table 88-4 Coordinated Cache Support for Service Channel Configuration
Coordinated Cache | Using TopLink Workbench |
Using Java |
---|---|---|
JMS Coordinated Cache |
|
|
RMI Coordinated Cache |
|
|
CORBA Coordinated Cache |
|
|
Custom Coordinated Cache |
|
|
To specify the service channel, use this procedure:
Select a session or session broker in the Navigator. Its properties appear in the Editor.
Click the Cache Coordination tab. The Cache Coordination tab appears.
Ensure the Enable Cache Coordination option is selected, then select the appropriate coordinated cache Type (see Table 88-4). The cache coordination options appear on the tab.
Figure 88-2 Cache Coordination Tab, Channel Field
In the Channel field, enter the name of the service channel for this coordinated cache.
A multicast group address is an Internet Protocol (IP) address in the range 224.0.0.0 to 239.255.255.255 that identifies the members of an IP multicast group. To efficiently broadcast the same message to all members of an IP multicast group, you configure each recipient with the same multicast group address and send the message to that address.
Table 88-5 summarizes which coordinated caches support multicast group address configuration.
Table 88-5 Coordinated Cache Support for Multicast Group Address Configuration
Coordinated Cache | Using TopLink Workbench |
Using Java |
---|---|---|
JMS Coordinated Cache |
|
|
RMI Coordinated Cache |
|
|
CORBA Coordinated Cache |
|
|
Custom Coordinated Cache |
|
|
Note: Ensure your host and network are configured to support multicast operation before configuring this option. |
In addition to configuring the multicast group address, you must also configure the multicast port (see "Configuring a Multicast Port") for the coordinated cache types shown in Table 88-5.
To specify the multicast group address, use this procedure:
Select a session or session broker in the Navigator. Its properties appear in the Editor.
Click the Cache Coordination tab. The Cache Coordination tab appears.
Ensure the Enable Cache Coordination option is selected, then select the appropriate coordinated cache Type (see Table 88-5). The cache coordination options appear on the tab.
Figure 88-3 Cache Coordination Tab, Multicast Group Address Field
Enter the multicast group address in the range 224.0.0.0 to 239.255.255.255 to subscribe this session to a given coordinated cache.
The multicast port is the port on which multicast messages are received. Members of a multicast group (see "Configuring a Multicast Group Address") rely on messages broadcast to their multicast group address to communicate with one another.
Table 88-6 summarizes which coordinated caches support multicast port configuration.
Table 88-6 Coordinated Cache Support for Multicast Port Configuration
Coordinated Cache | Using TopLink Workbench |
Using Java |
---|---|---|
JMS Coordinated Cache |
|
|
RMI Coordinated Cache |
|
|
CORBA Coordinated Cache |
|
|
Custom Coordinated Cache |
|
|
Note: Ensure your host and network are configured to support multicast operation before configuring this option |
To specify the multicast port, use this procedure:
Select a session or session broker in the Navigator. Its properties appear in the Editor.
Click the Cache Coordination tab. The Cache Coordination tab appears.
Ensure the Enable Cache Coordination option is selected, then select the appropriate coordinated cache Type (see Table 88-6). The cache coordination options appear on the tab.
Figure 88-4 Cache Coordination Tab, Multicast Port Field
Enter the multicast port on which messages broadcast to the multicast group address are received.
The session's message transport service uses a naming service when it looks up connections to other sessions in the coordinated cache. You can configure the message transport service to look up remote objects using an RMI registry or Java Naming and Directory Interface (JNDI). By default, JNDI is used.
Table 88-7 summarizes which coordinated caches support naming service configuration.
Table 88-7 Coordinated Cache Support for Naming Service Configuration
Coordinated Cache | JNDI Naming Service | RMI Registry Naming Service |
---|---|---|
JMS Coordinated Cache |
|
|
RMI Coordinated Cache |
|
|
CORBA Coordinated Cache |
|
|
Custom Coordinated Cache |
|
|
For information, see:
The session's message transport service uses a naming service when it looks up connections to other sessions in the coordinated cache. If you choose to use a JNDI naming service, you must configure JNDI naming service information.
Table 88-8 summarizes which coordinated caches support JNDI naming service configuration.
Table 88-8 Coordinated Cache Support for JNDI Naming Service Configuration
Coordinated Cache | Using TopLink Workbench |
Using Java |
---|---|---|
JMS Coordinated Cache |
|
|
RMI Coordinated Cache |
|
|
CORBA Coordinated Cache |
|
|
Custom Coordinated Cache |
|
|
TopLink uses JNDI naming service information differently, depending on the type of coordinated cache.
For a JMS coordinated cache, when a particular session's coordinated cache starts up, it uses its JNDI naming service information to locate and create a connection to the JMS server. The coordinated cache is ready when all participating sessions are connected to the JMS server. At this point, sessions can start sending and receiving object change messages. You can then configure all sessions that are participating in the same coordinated cache with the same JNDI naming service information.
For an RMI or CORBA coordinated cache, when a particular session's coordinated cache starts up, the session binds its connection in JNDI, creates an announcement message (that includes its own JNDI naming service information), and broadcasts the announcement to its multicast group (see "Configuring a Multicast Group Address" and "Configuring a Multicast Port"). When a session that belongs to the same multicast group receives this announcement, it uses the JNDI naming service information in the announcement message to establish bidirectional connections with the newly announced session's coordinated cache. The coordinated cache is ready when all participating sessions are interconnected in this way, at which point, sessions can start sending and receiving object change messages. You can then configure each session with JNDI naming information that identifies the host on which the session is deployed.
To specify the sessions's JNDI naming service, use this procedure:
Select a session or session broker in the Navigator. Its properties appear in the Editor.
Click the Cache Coordination tab. The Cache Coordination tab appears.
Ensure the Enable Cache Coordination option is selected, then select the appropriate coordinated cache Type (see Table 88-8). The cache coordination options appear on the tab.
Figure 88-5 Cache Coordination Tab, JNDI Naming Service Options
Use the following information to enter data in the fields of the Cache Coordination tab to configure the naming service options:
Field | Description |
---|---|
URL | The location of the JNDI naming service.
For a JMS coordinated cache: If you are using the Oracle Containers for J2EE (OC4J) JNDI naming service and all the hosts in your coordinated cache can communicate using the OC4J proprietary RMI protocol ORMI, use a URL similar to the following: ormi://<JMS-host-IP>:<JMS-host-port> where For an RMI or CORBA coordinated cache: If you are using the OC4J JNDI naming service and all the hosts in your coordinated cache can communicate using the OC4J proprietary RMI protocol ORMI on OC4J default port 23791, use a URL similar to the following: ormi://<session-host-IP>:23791 where |
Username | The user name required to log in to the JNDI naming service.
The value you enter defines the |
Password | The plain text (unencrypted) password required to log in to the JNDI naming service. The password appears in plain text in TopLink Workbench, but it is encrypted when written to the sessions.xml file
The value you enter defines the |
Initial Context Factory | The name of the factory class, provided by your JNDI naming service provider, that implements the javax.naming.spi.InitialContextFactory interface. This factory class is used to create a javax.naming.Context instance that can access the JNDI naming service provider's context implementation.
The value you enter defines the |
Properties | The JNDI context properties.
Click Properties to configure custom JNDI context properties (see "Configuring Context Properties"). |
The session's message transport service uses a naming service when it looks up connections to other sessions in the coordinated cache. If you choose to use an RMI registry naming service, you can configure RMI registry naming service options.
Table 88-8 summarizes which coordinated caches support RMI registry naming service configuration.
Table 88-9 Coordinated Cache Support for RMI Registry Naming Service Configuration
Coordinated Cache | Using TopLink Workbench |
Using Java |
---|---|---|
JMS Coordinated Cache |
|
|
RMI Coordinated Cache |
|
|
CORBA Coordinated Cache |
|
|
Custom Coordinated Cache |
|
|
For an RMI coordinated cache, when a particular session's coordinated cache starts up, the session binds its connection in its RMI registry, creates an announcement message (that includes its own naming service information), and broadcasts the announcement to its multicast group (see "Configuring a Multicast Group Address" and "Configuring a Multicast Port"). When a session that belongs to the same multicast group receives this announcement, it uses the JNDI naming service information in the announcement message to establish bidirectional connections with the newly announced session's coordinated cache. The coordinated cache is ready when all participating sessions are interconnected in this way, at which point, sessions can start sending and receiving object change messages. You can then configure each session with RMI registry naming information that identifies the host on which the session is deployed.
To specify the sessions's registry naming service, use this procedure:
Select a session or session broker in the Navigator. Its properties appear in the Editor window.
Click the Cache Coordination tab. The Cache Coordination tab appears.
Ensure the Enable Cache Coordination option is selected, then select the appropriate coordinated cache Type (see Table 88-9). The cache coordination options appear on the tab.
Figure 88-6 Cache Coordination Tab, Naming Service Options
Use the following information to configure the naming service options:
Field | Description |
---|---|
URL | Assuming that you are using the OC4J JNDI naming service and that all the hosts in your coordinated cache can communicate using the OC4J proprietary RMI protocol ORMI on OC4J default port 23791, use a URL similar to the following:
ormi://<session-host-IP>:23791 where |
Use the announcement delay option to set the amount of time (in milliseconds) that a session should wait between the time that it is available and the time that it broadcasts its announcement message to the members of the coordinated cache. This additional delay may be necessary to give some systems more time to post their connections into the naming service (see "Configuring a Naming Service Type").
Table 88-10 summarizes which coordinated caches support announcement delay configuration.
Table 88-10 Coordinated Cache Support for Announcement Delay Configuration
Coordinated Cache | Using TopLink Workbench |
Using Java |
---|---|---|
JMS Coordinated Cache |
|
|
RMI Coordinated Cache |
|
|
CORBA Coordinated Cache |
|
|
Custom Coordinated Cache |
|
|
In addition to announcement delay, you may also need to consider packet time-to-live configuration (see "Configuring a Packet Time-to-Live").
To specify the announcement delay (in milliseconds) for an RMI coordinated cache, use this procedure:
Select a session or session broker in the Navigator. Its properties appear in the Editor.
Click the Cache Coordination tab. The Cache Coordination tab appears.
Ensure the Enable Cache Coordination option is selected, then select the appropriate coordinated cache Type (see Table 88-10). The cache coordination options appear on the tab.
Figure 88-7 Cache Coordination Tab, Announcement Delay Field
Select the amount of time (in milliseconds) that this session should wait between the time that it is available and the time that it broadcasts its announcement message to the members of the coordinated cache.
The session's transport manager creates connections to the various members of the coordinated cache. If a communication error occurs on one of these connections, you can configure the session to either ignore the error or remove the connection.
Table 88-11 summarizes which coordinated caches support connection handling configuration.
Table 88-11 Coordinated Cache Support for Connection Handling Configuration
Coordinated Cache | Using TopLink Workbench |
Using Java |
---|---|---|
JMS Coordinated Cache |
|
|
RMI Coordinated Cache |
|
|
CORBA Coordinated Cache |
|
|
Custom Coordinated Cache |
|
|
If you configure the session to remove the connection on error, the next time the session tries to communicate with that coordinated cache member, it will construct a new connection.
If you configure the session to ignore the error, the next time the session tries to communicate with that coordinated cache member, it will continue to use the same connection.
To specify how TopLink handles session connections in the event of an error, use this procedure:
Select a session or session broker in the Navigator. Its properties appear in the Editor.
Click the Cache Coordination tab. The Cache Coordination tab appears.
Ensure the Enable Cache Coordination option is selected, then select the appropriate coordinated cache Type (see Table 88-11). The cache coordination options appear on the tab.
Figure 88-8 Cache Coordination Tab, Remove Connection on Error Option
Select the Remove Connection on Error option to configure the session to remove the data source connection in the event of an error.
When you configure a coordinated cache to use a JNDI naming service (see "Configuring a Naming Service Type"), you can add new environment properties to the environment of the initial JNDI context.
Table 88-12 summarizes which coordinated caches support context properties.
Table 88-12 Coordinated Cache Support for Context Properties
Coordinated Cache | Using TopLink Workbench |
Using Java |
---|---|---|
JMS Coordinated Cache |
|
|
RMI Coordinated CacheFoot 1 |
|
|
CORBA Coordinated CacheFootref 1 |
|
|
Custom Coordinated Cache |
|
|
Footnote 1 When JNDI naming service is selected (see "Configuring a Naming Service Type").
Using TopLink Workbench, TopLink uses the new environment properties you add to create the initial context for both local and remote JNDI access.
Using Java, you can configure different properties for local and remote JNDI access using a session customizer class to call TransportManager
methods setLocalContextProperties
and setRemoteContectProperties
(for more information, see "Configuring Customizer Class").
To define JNDI context properties, use this procedure:
Select a session or session broker in the Navigator. Its properties appear in the Editor.
Ensure the Enable Cache Coordination option is selected, then select the appropriate coordinated cache Type (see Table 88-12). The cache coordination options appear on the tab.
Ensure the JNDI Naming Service option is selected. See "Configuring a Naming Service Type".
In the JNDI Naming Service area, click Properties. The Edit Properties dialog box appears.
Click Add to create a new property. The Add New Property dialog box appears.
To change (or delete) an existing property, select the property and click Edit (or Remove).
Use this table to enter data in the following fields on the dialog box.
Field | Description |
---|---|
Name | The name of the property. |
Value | The value of the property. |
The packet time-to-live is the number of hops that session data packets can take before expiring. The default is 2. This allows for a hub and an interface card, and prevents the data packets from leaving the local network. If sessions are hosted on different local area networks (LANs) that are part of wide area network (WAN), or if a firewall configuration prevents it, the announcement sent by one session may not reach the other sessions in the coordinated cache. In this case, consult your network administrator for the correct time-to-live value.
Table 88-13 summarizes which coordinated caches support packet time-to-live configuration.
Table 88-13 Coordinated Cache Support for Packet Time-to-Live Configuration
Coordinated Cache | Using TopLink Workbench |
Using Java |
---|---|---|
JMS Coordinated Cache |
|
|
RMI Coordinated Cache |
|
|
CORBA Coordinated Cache |
|
|
Custom Coordinated Cache |
|
|
In addition to configuring packet time-to-live, you may also need to configure announcement delay (see "Configuring an Announcement Delay").
To specify the number of hops that session data packets can take before expiring, use this procedure:
Select a session or session broker in the Navigator. Its properties appear in the Editor.
Ensure the Enable Cache Coordination option is selected, then select the appropriate coordinated cache Type (see Table 88-12). The cache coordination options appear on the tab.
Figure 88-10 Cache Coordination Tab, Packet Time to Live Field
In the Packet Time to Live field, specify the number of hops (default = 2
) that session data packets can take before expiring.