WebSphere Application Server 传统版与 Liberty 之间的配置差异:dataSource 元素和 jdbcDriver 元素

Liberty 中 dataSource 的配置与 WebSphere® Application Server 传统版中数据源的配置之间存在一些差异。

  • 数据源属性的名称不同
    • ifxIFX_LOCK_MODE_WAIT,在 WebSphere Application Server 传统版中是 informixLockModeWait
    • supplementalJDBCTrace,在 WebSphere Application Server 传统版中是 supplementalTrace
    • transactional,在 WebSphere Application Server 传统版中是 nonTransactionalDataSource
    • isolationLevel,在 WebSphere Application Server 传统版中是 webSphereDefaultIsolationLevel
    • queryTimeout,在 WebSphere Application Server 传统版中是 webSphereDefaultQueryTimeout
    • id,在 WebSphere Application Server 传统版中是 name
  • 数据源属性的值不同
    • beginTranForResultSetScrollingAPIs,缺省情况下,在 Liberty 中是 true
    • beginTranForVendorAPIs,缺省情况下,在 Liberty 中是 true
    • connectionSharing,缺省情况下,在 Liberty 中是 MatchOriginalRequest
    • statementCacheSize,在 WebSphere Application Server 传统版中是 JDBC 提供程序属性,在 Liberty 中是 dataSource 属性,缺省值为 10
  • 不具有等效 Liberty 的 WebSphere Application Server 传统版中数据源属性
    • category
    • supportsDynamicUpdates
  • 数据源的 connectionSharing 属性
    • Liberty 允许将 connectionSharing 配置为 MatchOriginalRequestMatchCurrentState。缺省情况下,它是 MatchOriginalRequest
    • WebSphere Application Server 传统版允许以更细颗粒的方式配置 connectionSharing,其中,个别连接属性可以根据原始连接请求或连接的当前状态进行匹配。在WebSphere Application Server 传统版中,connectionSharing 是位组合,这些位表示要根据连接的当前状态进行匹配的连接属性。在 WebSphere Application Server 传统版中,值为 0 表示匹配所有基于原始连接请求的属性。值为 -1 表示匹配所有基于当前连接状态的属性。WebSphere Application Server 传统版的缺省值为 1,这表示根据连接的当前状态匹配隔离级别。根据原始连接请求匹配所有其他属性。
  • 数据源的持续时间属性
    可以使用 Liberty 中的单位来选择性地指定持续时间属性。例如,
    <dataSource id="informix" jndiName="jdbc/informix" queryTimeout="5m"  ...>
            <properties.informix ifxIFX_LOCK_MODE_WAIT="120s" .../>
        </dataSource>
    请参阅 Java Database Connectivity 4.1,以获取 dataSource 元素的可接受时间单位和格式。省略 Liberty 中的单位等价于WebSphere Application Server 传统版中使用的缺省单位。
  • JDBC 驱动程序的配置
    • 在 Liberty 中,可以采用相同的方法来配置具备 XA 功能及不具备 XA 功能的数据源实现类的不同 jdbcDriver 元素。此外,还可以对两者使用单个 jdbcDriver 元素。定义多个 jdbcDriver 元素并不会导致使用不同的类装入器。在 Liberty 中,jdbcDriver 元素总是使用与这些元素一起配置的共享库的类装入器。
    • WebSphere Application Server 传统版中,定义了一个指向 JDBC 驱动程序 JAR、压缩文件和本机文件的 JDBC 提供程序。必须为具备 XA 功能及不具备 XA 功能的数据源实现类定义单独的 JDBC 提供程序。
    对于某些常用的 JDBC 驱动程序,Liberty 会推断基于驱动程序 JAR 名称的数据源实现类名。因此,可以省略实现类名。例如:
    <jdbcDriver id="Derby" libraryRef="DerbyLib"/>
    <library id="DerbyLib">
           <fileset dir="C:/Drivers/derby" includes="derby.jar" />
        </library>

    使用缺省实现类的可选属性来覆盖这些类,例如 javax.sql.DataSourcejavax.sql.ConnectionPoolDataSourcejavax.sql.XADataSource

    要覆盖 Liberty 选择的缺省 javax.sql.XADataSourcejavax.sql.ConnectionPoolDataSource 实现:
    <jdbcDriver id="Derby" libraryRef="DerbyLib" 
          javax.sql.XADataSource="org.apache.derby.jdbc.EmbeddedXADataSource" 
          javax.sql.ConnectionPoolDataSource="org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource"/>
       <library id="DerbyLib">
          <fileset dir="C:/Drivers/derby" includes="derby.jar" />
       </library>
    有关 jdbcDriver 元素的更多信息,请参阅 Java Database Connectivity 4.1

用于指示主题类型的图标 参考主题



时间戳记图标 最近一次更新时间: Monday, 5 December 2016
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-libcore-mp&topic=rwlp_ds_diff
文件名:rwlp_ds_diff.html