Wednesday Apr 03, 2013

Using Oracle WebLogic datasources with OUAF based products

By default, the online (and XAI) components of the Oracle Utilities Application Framework use Universal Connection Pool (or c3p0 for Oracle Utilities Application Framework V2.x) for connection pooling. If you wish to use Oracle WebLogic JDBC based connection pooling for integration to other products or to use the GridLink features of Oracle WebLogic, then Oracle Utilities Application Framework needs to be configured to use Oracle WebLogic datasources.

The following process can be used for this:

  • Define the JDBC datasource to the product database, using the Oracle WebLogic console, with the following attributes:
    • The JNDI Name for the datasource should contain a directory name such as jdbc. For example, jdbc/demodb. The name of the JNDI should reflect your site requirements.
    • Ensure that Global Transaction Support is disabled on the JDBC connection. This is not appropriate for this integration.
    • The XA JDBC driver may be used but the product does not take advantage of the XA feature set.
    • The Instance or Service driver may be used but if there is no site preference use the Service driver.
    • The Database User and Password to use should be any database user with read/write access to the product such as CISUSER or SPLUSER. The value can correspond to the value of the DBUSER configuration variable in the ENVIRON.INI, if no site preference exists.

     

  • If your site is using Oracle WebLogic in embedded mode the above change will change the Oracle WebLogic config.xml to add the JDBC resource. To retain changes over upgrade and patches do the following:
    • For products using Oracle Utilities Application Framework V2.x, you should copy the config.xml.template (or config.xml.win.template for Windows) in the etc directory and create a cm version (add cm. as the name prefix) and add the following lines: 
<jdbc-system-resource>
    <name>demodb</name>
    <target>myserver</target>
    <descriptor-file-name>jdbc/demodb-jdbc.xml</descriptor-file-name>
</jdbc-system-resource>
<internal-apps-deploy-on-demand-enabled>false</internal-apps-deploy-on-demand-enabled>

Note: The values for name, target and descriptor-file-name tags should be altered to suit your JDBC connection. The internal-apps-deploy-on-demand-enabled is not required but is included for sequence reference purposes.

    •  For products using Oracle Utilities Application Framework V4.x then the above XML code should be placed in the cm_config.xml.exit_3.include file (or CM_config.xml.win.exit_3.include for Windows) in the templates directory. This is using the new user exit method introduced in Oracle Utilities Application Framework V4.x which avoids the need for a cm template altogether.
  •   To use the new JDBC datasource for online the following must be performed:
    • Copy the hibernate.properties.web.tempate to cm.hibernate.properties.web.tempate within the relevant directory. For Oracle Utilities Application Framework V2.x the directory is the etc subdirectory, and Oracle Utilities Application Framework V4.x the directory is the template subdirectory. This will tell the utilities to override the base template with the custom template.
    • Add the following lines to the top of the cm template file:
hibernate.connection.datasource = <jdbc_jndi>
hibernate.connection.username = <jndi_user>
hibernate.connection.password = <jndi_user_password>

where :

<jdbc_jndi> - Full JNDI name for the JDBC connection
<jndi_user> - A user to access the JNDI (Substitution variable @WEB_WLSYSUSER@ can be used in the template).
<jndi_user_password> - The password for the user to access the JNDI (Substitution variable @WEB_WLSYSPASS@ can be used in the template).

    • Remove the following lines from the cm template file depending on the version of the Oracle Utilities Application Framework:  
       Framework Version  Lines to remove
       2.2.x, 4.0.x All hibernate.connection.url entries including any ifdef statements
      All hibernate.c3p0.* entries
       4.1.x, 4.2.x All hibernate.connection.url entries including any ifdef statements
      All hibernate.ucp.* entries
    • Change the hibernate.transaction.factory_class setting to org.hibernate.transaction.JDBCTransactionFactory
    • Change the hibernate.connection.provider_class to org.hibernate.connection.DatasourceConnectionProvider
    • Save the file. For Oracle Utilities Application Framework V4.2 and above the sample cm template is shown below:
hibernate.connection.driver_class = @DBDRIVER@
hibernate.connection.datasource = jdbc/demodb
hibernate.connection.username = @WEB_WLSYSUSER@
hibernate.connection.password = @WEB_WLSYSPASS@
hibernate.dialect = @DIALECT@
hibernate.show_sql = false
hibernate.max_fetch_depth = 2
hibernate.transaction.factory_class = org.hibernate.transaction.JDBCTransactionFactory
hibernate.jdbc.fetch_size = 100
hibernate.jdbc.batch_size = 30
hibernate.query.factory_class = org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory
hibernate.cache.use_second_level_cache = false
hibernate.query.substitutions = true 'Y', false 'N'
hibernate.connection.provider_class=org.hibernate.connection.DatasourceConnectionProvider
hibernate.connection.release_mode=on_close
#ouaf_user_exit hibernate.properties.exit.include
#ouaf_user_exit hibernate.properties.web.exit.include
  • Execute the initialSetup[.sh] command to apply the changes and new templates.

Note: For products using the Oracle Utilities Application Framework V4.x you can execute the initialSetup[.sh] –t command to apply the changes. This avoids an EAR rebuild.

  • Restart the server to verify the connection is active 

Now the data source is used from Oracle WebLogic for online as well as XAI. This technique does not apply to batch as Oracle WebLogic is not used for batch, this will continue to use UCP or c3p0 (depending on the version of Oracle Utilities Application Framework is used).

About

Anthony Shorten
Hi, I am Anthony Shorten, I am the Principal Product Manager for the Oracle Utilities Application Framework. I have been working for over 20+ years in the IT Business and am the author of many a technical whitepaper, manual and training material. I am one of the product managers working on strategy and designs for the next generation of the technology used for the Utilities and Tax markets. This blog is provided to announce new features, document tips and techniques and also outline features of the Oracle Utilities Application Framework based products. These products include Oracle Utilities Customer Care and Billing, Oracle Utilities Meter Data Management, Oracle Utilities Mobile Workforce Management and Oracle Enterprise Taxation and Policy Management. I am the product manager for the Management Pack for these products.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
9
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today