This topic applies to WebSphere Application Server Liberty V8.5.5.9 and earlier. For the latest Liberty topics, see the WebSphere Application Server Liberty documentation.
Configuration differences between the traditional and Liberty: dataSource and jdbcDriver elements
There are some differences in configuration between dataSource in Liberty and data sources in the traditional .
- Data source properties with different names
- ifxIFX_LOCK_MODE_WAIT, which is informixLockModeWait in traditional.
- supplementalJDBCTrace, which is supplementalTrace in traditional.
- transactional, which is nonTransactionalDataSource in traditional.
- isolationLevel, which is webSphereDefaultIsolationLevel in traditional.
- queryTimeout, which is webSphereDefaultQueryTimeout in traditional.
- id, which is name in traditional.
- Data source properties with different values
- beginTranForResultSetScrollingAPIs, which is true by default in Liberty
- beginTranForVendorAPIs, which is true by default in Liberty
- connectionSharing, which is MatchOriginalRequest by default in Liberty
- statementCacheSize, which is is a JDBC provider property in traditional, and a dataSource property in Liberty, with a default value of 10.
- Data source properties in traditional that have
no Liberty equivalent
- category
- supportsDynamicUpdates
- connectionSharing property of data sources
- Liberty allows connectionSharing to be configured to either MatchOriginalRequest or MatchCurrentState. By default, it is MatchOriginalRequest.
- The traditional allows connectionSharing to be configured in a finer grained manner, where individual connection properties can be matched based on the original connection request or the current state of the connection. In the traditional, connectionSharing is a combination of bits representing which connection properties to match based on the current state of the connection. In the traditional, a value of 0 means to match all properties based on the original connection request; a value of -1 means to match all properties based on the current state of the connection. The default value for the traditional is 1, which means that the isolation level is matched based on the current state of the connection and all other properties are matched based on the original connection request.
- Time duration properties of data sourceTime duration properties can optionally be specified with units in Liberty. For example,
See **** MISSING FILE **** for accepted time units and formats of dataSource element. Omitting the units in Liberty is equivalent to the default units used in the traditional.<dataSource id="informix" jndiName="jdbc/informix" queryTimeout="5m" ...> <properties.informix ifxIFX_LOCK_MODE_WAIT="120s" .../> </dataSource>
- Configuration for JDBC drivers
- In Liberty, you can take the same approach of configuring different jdbcDriver elements for XA capable and non-XA capable data source implementation classes. Alternatively, you can use a single jdbcDriver element for both. Defining multiple jdbcDriver elements does not cause different class loaders to be used. In Liberty, jdbcDriver elements always use the class loader of the shared library with which they are configured.
- In the traditional, a JDBC provider is defined to point to the JDBC driver JARs, compressed files, and native files. You must define separate JDBC providers for XA capable and non-XA capable data source implementation classes.
For some of the commonly used JDBC drivers, Liberty infers the data source implementation class names based on the names the driver JARs. Therefore, you can omit the implementation class names. For example:<jdbcDriver id="Derby" libraryRef="DerbyLib"/> <library id="DerbyLib"> <fileset dir="C:/Drivers/derby" includes="derby.jar" /> </library>
Use the optional properties of the default implementation classes to override these classes such as javax.sql.DataSource, javax.sql.ConnectionPoolDataSource, and javax.sql.XADataSource.
The following example shows how to override the default javax.sql.XADataSource and javax.sql.ConnectionPoolDataSource implementations that Liberty selects
See **** MISSING FILE **** for more information about the jdbcDriver element.<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>