The CDC adapter reports an unexpected message when connecting to a SQL Server table that is already CDC-enabled

The CDC adapter reports an unexpected message when connecting to a SQL Server table that is already CDC-enabled

book

Article ID: KB0072503

calendar_today

Updated On:

Products Versions
TIBCO Streaming 10.6.2 and earlier

Description

For a SQL Server table that has already been configured for change data capture (CDC), the Streaming Database Change Data Capture Input Adapter does not need to enable its "Perform Enable CDC Calls" property. This property is only needed when you want the Streaming CDC adapter to enable CDC for your SQL Server table.

However, in Streaming 10.6.2 and earlier, if you un-check "Perform Enable CDC calls" in the adapter Properties view in Streaming Studio while other properties set in your adapter configuration are not correct (e.g. the database user is not correct), you can expect to see the following message logged to the console if the adapter:
 
WARN SQLServerCDC: Adapter is shutting down: Error enabling change data capture 
for table 'myschema.Customers': Object does not exist or access is denied.

This message is confusing, because it indicates that the adapter is attempting to enable CDC for a table that already has CDC enabled. However, in this case, the error is due to the database user (configured in the adapter properties) not having SELECT permissions on the table myschema.Customers. Refer to Microsoft's Documentation regarding the message "Object does not exist or access is denied":

"Requires membership in the db_owner fixed database role. For all other users, requires SELECT permission on all captured columns in the source table and, if a gating role for the capture instance was defined, membership in that database role. When the caller does not have permission to view the source data, the function returns error 22981 (Object does not exist or access is denied.)."
 

Issue/Introduction

This article describes the unexpected behavior and WARN message when the CDC adapter tries to connect to a SQL Server table that is already CDC-enabled. This message will be changed for more clarity in a future release.

Resolution

In this scenario, where CDC is already enabled for this table, only the last portion of the above console message should be considered (i.e. "Object does not exist or access is denied"). The earlier portion of the message (i.e. "Error enabling change data capture for table") may be ignored, since the adapter is not actually attempting to enable CDC for this table. Instead, the adapter is simply unable to get CDC updates from this table (due to the permissions issue noted above). If SELECT permissions are then granted to the db user configured in the CDC adapter, this WARN message should not occur.

In future releases, this console message will be changed for increased clarity.