Configuration differences between the WebSphere Application Server traditional and Liberty: dataSource and jdbcDriver elements
Some differences exist in the 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 WebSphere Application Server traditional.
- supplementalJDBCTrace, which is supplementalTrace in WebSphere Application Server traditional.
- transactional, which is nonTransactionalDataSource in WebSphere Application Server traditional.
- isolationLevel, which is webSphereDefaultIsolationLevel in WebSphere Application Server traditional.
- queryTimeout, which is webSphereDefaultQueryTimeout in WebSphere Application Server traditional.
- id, which is name in 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 is a JDBC provider property in WebSphere Application Server traditional, and a dataSource property in Liberty, with a default value of 10.
- Data source properties in WebSphere Application Server 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 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. 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 id="informix" jndiName="jdbc/informix" queryTimeout="5m" ...> <properties.informix ifxIFX_LOCK_MODE_WAIT="120s" .../> </dataSource>
dataSource
element. Omitting the units in Liberty is equivalent to the default units used in the WebSphere Application Server traditional. - 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 singlejdbcDriver
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
, andjavax.sql.XADataSource
.To override the defaultjavax.sql.XADataSource
andjavax.sql.ConnectionPoolDataSource
implementations that Liberty selects:
For more information about the<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
element, see Java Database Connectivity 4.1. - In Liberty, you can take the same approach of configuring different