DSI shuts down because of SQL error in transaction

Symptom

The following error messages are displayed in the Replication Server error log. The Data Server Interface (DSI) thread shuts down.

An Adaptive Server error is included in the text of the Replication Server error:

E. 2006/06/13 12:31:29. ERROR #1028 DSI(western.west1)-
dsiqmint.c(3645) Message from server: Message: 229,
State: 1, Severity: 14-- ‘DELETE permission denied on
object real_run, database west1, owner dbo’. 
H. 2006/06/13 12:31:29. THREAD FATAL ERROR #5049
DSI(western.west1) - dsiqmint.c(3652) The DSI thread
for database ‘western.west1’ is being shutdown. DSI
received data server error #229 which is mapped to
STOP_REPLICATION. See logged data server errors for more
information. The data server error was caused by RS
output command #1 mapped from input command #2 of the
failed transaction. 
I. 2006/06/13 12:31:29. The DSI thread for database
‘western.west1’ is shutdown. The Message from server:
text is the message you would get from the Adaptive
Server had you sent the command batch to the server with
isql. The text is taken from the table sysmessages. In
isql you would get: Msg 229, Level 14, State 1: DELETE
permission denied on object real_run, database west1,
owner dbo

Explanation

These errors occur when a Replication Server transaction that is sent to the replicate Adaptive Server has a SQL error. The replicate Adaptive Server detects the SQL error in the transaction and returns a message to the Replication Server.

The Replication Server responds by shutting down the connection and suspending replication; this prevents data inconsistencies between the primary and replicate sites. It allows the user to correct the problem at the replicate Adaptive Server and to maintain data consistency.

For example, when a SQL semantic error occurs in a referential integrity or duplicate keys situation, Adaptive Server sends its message back to Replication Server. In response, Replication Server shuts down the connection and records the Replication Server error in the Replication Server error log. The Adaptive Server error is referenced in the body of the Replication Server error.

Solution

Fix the problem in Adaptive Server and resume the connection as described in the Solutions section of 1028: data server errors. If the problem persists, verify that autocorrection for the subscription has been turned on in the rs_repobjs.attributes table of the RSSD. Also, check for triggers that enforce referential integrity rules.