Configuration differences between the WebSphere Application Server traditional and Liberty: dataSource and jdbcDriver elements
There are some differences in configuration between dataSource in Liberty and data sources in the WebSphere® Application Server traditional.
- Data source properties with different names
- ifxIFX_LOCK_MODE_WAIT, which is informixLockModeWait in the WebSphere Application Server traditional.
- supplementalJDBCTrace, which is supplementalTrace in the WebSphere Application Server 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 10 by default in Liberty
- connectionSharing property of data sources
- Liberty allows connectionSharing to be configured to either MatchOriginalRequest or MatchCurrentState. By default, it is MatchOriginalRequest.
- The WebSphere Application Server 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 WebSphere Application Server traditional, connectionSharing is a combination of bits representing which connection properties to match based on the current state of the connection. In the WebSphere Application Server traditional, a value of 0 means to match all properties that are based on the original connection request; a value of -1 means to match all properties that are based on the current state of the connection. The default value for the WebSphere Application Server 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 Java Database Connectivity 4.1 for accepted time units and formats of dataSource element. Omitting the units in Liberty is equivalent to the default units used in the WebSphere Application Server 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 WebSphere Application Server 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 that are 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 Java Database Connectivity 4.1 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>
Reference topic