Creating a Container Oracle RAC Data Source Creating a MapViewer Data Source

1-38 Oracle Fusion Middleware Users Guide for Oracle MapViewer bounding box MBR, and tile size and format. Click Submit to create the map tile layer. You can also define the map cache properties in XML by clicking XML. ■ Managing map tile layers for Oracle Maps Click Manage Map Caches, then Manage. Then do any of the following: To refresh map caches, click Refresh. To edit a map tile layer, under Existing Map Tile Layers, select the data source. At the cache level, you can delete the cache, view cache details, and place the cache offline or online. At the tile level, you can perform operations such as clearing, prefetching, and refreshing the tiles, specifying the zoom level, and specifying the bounding box. To check the status of a request, enter the request ID and click Submit.

1.6 Oracle Real Application Clusters and MapViewer

When the database is an Oracle Real Application Cluster Oracle RAC, you cannot create MapViewer data sources that directly connect to it. Instead, MapViewer must connect to an Oracle RAC database through the data source of the J2EE container. To enable MapViewer to connect to an Oracle RAC database, you must do the following: 1. Create a JDBC data source that connects to the Oracle RAC database at the OC4J level, as explained in Section 1.6.1 . The data source can then be used by applications such as MapViewer through JNDI lookup. 2. Configure the OC4J instance so that it publishes the JNDI location of the Oracle RAC data source so that MapViewer can access it, as explained in Section 1.6.2 . 3. Define a MapViewer data source that reuses the container data source through the JNDI location in its configuration file, as explained in Section 1.6.3 . 4. Restart MapViewer.

1.6.1 Creating a Container Oracle RAC Data Source

With either a full Oracle Fusion Middleware or standalone OC4J installation, use Oracle Enterprise Manager to create a data source that connects to the Oracle RAC database. For example, if using Oracle Application Server release 10.1.3 or later, you can log in to Enterprise Manager, navigate to the OC4J instance that contains the MapViewer server, click the Administration tab, and click the JDBC Resources Go to Task link to start creating a new data source, as shown in Figure 1–12 . Introduction to MapViewer 1-39 Figure 1–12 Administration Tab for Creating Oracle RAC Container Data Source For more information about creating a data source to connect to an Oracle RAC database, see Oracle Application Server Administrators Guide. After creating the data source, you should test the connection using Enterprise Manager, by clicking the Test Connection icon for the connection, as shown in Figure 1–13 . Figure 1–13 Testing the Connection for the Data Source 1-40 Oracle Fusion Middleware Users Guide for Oracle MapViewer Be sure to note the JNDI Location value which is jdbcmvdemods in Figure 1–13 , because you will need this value when you create the MapViewer data source explained in Section 1.6.3 .

1.6.2 Adding the userThreads Option to the OC4J Container

You must specify the userThreads option to tell the OC4J instance to publish the JNDI locations, such as the one for the newly created data source, to all user threads. Without this option, MapViewer cannot access the JNDI location that references the data source, because by default OC4J makes such JNDI locations available only to the main thread within which OC4J itself is running. MapViewer, however, is started in a separate user thread. The mechanism for specifying the userThreads option depends on whether you re using a standalone OC4J instance or a full Oracle Fusion Middleware installation.

1.6.2.1 Adding userThreads for a Standalone OC4J Instance

With a standalone OC4J instance, you must start the OC4J instance with the -userThreads option, as in the following example: java –jar oc4j.jar –userThreads

1.6.2.2 Adding userThreads for a Full Oracle Fusion Middleware 10gR3 Installation

With a full Oracle Fusion Middleware 10gR3 installation, the Java startup parameters are defined in the OAS_HOMEopmnconfopmn.xml configuration file. opmn is the master process that starts and stops various Oracle Fusion Middleware 10gR3 components, such as OC4J instances. In this file you can specify Java JVM startup parameters for the OC4J instance running MapViewer. For example, if you deployed MapViewer to the home OC4J instance, add the text -Doc4j.userThreads=true, as shown in the following example: ias-component id=OC4J process-type id=home module-id=OC4J status=enabled module-data category id=start-parameters data id=java-options value=-server -Djava.security.policy=ORACLE_HOMEj2eehomeconfigjava2.policy -Djava.awt.headless=true -Dhttp.webdir.enable=false -Doc4j.userThreads=true category ... After editing and saving the opmn.xml file, you must restart the OC4J instance for the userThreads option to take effect; and if that does not work, restart Oracle Fusion Middleware 10gR3. For information about restarting the OC4J instance or Oracle Fusion Middleware 10gR3, see Oracle Application Server Administrators Guide.

1.6.3 Creating a MapViewer Data Source

Create a new MapViewer data source that enables it to connect to the Oracle RAC database, by using the container_ds attribute of the MapViewer data source. Specifically, you must add an entry like the following in the mapViewerConfig.xml file: map_data_source name=mvdemo container_ds=jdbcmvdemods number_of_mappers=7 Introduction to MapViewer 1-41 In the preceding example: ■ The name attribute specifies the MapViewer data source name, which is needed for map requests. ■ The value for the container_ds attribute must match the JNDI Location string that you noted when you created the container Oracle RAC data source see Section 1.6.1 . ■ The number_of_mappers attribute specifies the maximum number of supported concurrent map requests that can target this data source. For more information about the name and number_of_mappers attributes, see Section 1.5.2.14 . After adding the data source definition, you must restart MapViewer to have the new data source created. After you do this, whenever you request a map from this data source, MapViewer obtains the necessary database connections from the container before proceeding.

1.7 High Availability and MapViewer

MapViewer users can benefit from the high availability features of Oracle Database and Oracle Fusion Middleware.

1.7.1 Deploying MapViewer on a Multiprocess OC4J Instance

You can safely deploy MapViewer in an OC4J instance of Oracle Fusion Middleware that has multiple processes. Oracle Fusion Middleware lets you configure the number of actual processes JVMs that can be started for each OC4J instance. On a multiprocessor host, starting multiple processes for a single OC4J can better utilize the system resources. Releases of MapViewer before 10g Release 2 10.1.2 could not take advantage of this feature and thus could not be deployed on such OC4J instances. When MapViewer is deployed to an OC4J instance with multiple processes, each process has a MapViewer server running inside it. These MapViewer servers all reside on the same host but in different Java processes. Map requests sent to this OC4J instance are automatically dispatched to the individual MapViewer servers. Each MapViewer server generates map image files according to a unique naming scheme, with the names coordinated when the different MapViewer servers are first started that is, when the containing OC4J instance is started. This avoids the possibility of two MapViewer servers generating map files in the same sequence with the same file names.

1.7.2 Deploying MapViewer on a Middle-Tier Cluster

OC4J instances in different Oracle Fusion Middleware 10gR3 installations can be clustered into an island. This provides a middle-tier fail-safe option. MapViewer can be deployed to an OC4J island. You must take care, however, about how the generated Note: This section is intended for advanced users who want to take full advantage of the high availability features of Oracle Fusion Middleware with MapViewer. You must have a strong understanding of high availability features, which are described in Oracle Fusion Middleware High Availability Guide.