DB2 10.5 for Linux, UNIX, and Windows

RetryOnMERGE IBM data server driver configuration keyword

Specifies the number of retry attempts that can be made for a MERGE statement when the application is connected to DB2® for Linux, UNIX, and Windows, DB2 for i, or DB2 for z/OS® servers. For connection to a DB2 for i server, the RetryOnMERGE keyword is supported on DB2 for i V7R1 and later releases.
Equivalent CLI keyword
RetryOnMERGE
Equivalent IBM® data server provider for .NET connection string keyword
N/A
IBM data server driver configuration file (db2dsdriver.cfg) syntax
<parameter name="RetryOnMERGE" value="0 | 1 | 2 | 3 | 4 | 5 | 6"/>
Default setting:
0
Equivalent connection and statement attribute:
SQL_ATTR_RETRY_ON_MERGE
Usage notes:
The CLI driver can use the RetryOnMERGE keyword to retry the MERGE statement that failed because the array input chaining was enabled. This situation occurs when two MERGE statements affect the same target object with the same search condition at the same time, causing one of the MERGE statements to succeed and the other to fail. You can enable the array input chaining feature for the connection to DB2 for Linux, UNIX, and Windows, DB2 for i, or DB2 for z/OS servers. You can use the ColumnwiseMRI keyword or the SQL_ATTR_COLUMNWISE_MRI attribute to enable the array input chaining feature when you are connecting to DB2 for z/OS servers. Use the ArrayInputChain keyword with the SQL_ATTR_CHAINING_BEGIN and SQL_ATTR_CHAINING_END statement attributes to enable the array input chaining feature when you are connecting to DB2 for Linux, UNIX, and Windows or DB2 for i servers.

The CLI driver allocates an array buffer that consists of 100 elements for each parameter that you provide when you use the SQLBindParameter() or SQLExtendedBind() function. When an error is encountered due to a resource contention issue on the server, the CLI driver constructs an array of failed rows and reruns the statement again for the number of iterations set with the RetryOnMERGE keyword.

0
The default value. No retry attempt is made.
1 - 6
Number of retry attempts that can be made. The maximum number of retry attempts is six.
The RetryOnMERGE keyword setting has no effect under the following conditions:
  • If any of the following data types are bound as a parameter in a MERGE operation:
    • SQL_CLOB
    • SQL_BLOB
    • SQL_LONGVARBINARY
    • SQL_LONGVARGRAPHIC
    • SQL_DBCLOB
    • SQL_XML
  • If a parameter is bound with the SQL_DATA_AT_EXEC argument in a MERGE operation, which requires calls to the SQLPutData() and SQLParamData() functions.
  • If any of the following statement attributes are specified in a MERGE operation:
    • SQL_ATTR_INTERLEAVED_PUTDATA
    • SQL_ATTR_INTERLEAVED_STREAM_PUTDATA
    • SQL_ATTR_USE_LOAD_API
  • If array parameters are specified for a MERGE operation.
  • If the SQL_ATTR_INSERT_BUFFERING statement attribute is enabled in a connection to a DB2 for Linux, UNIX, and Windows server.
  • If the CLI driver is unable to allocate required internal buffers to store application data.