Commits a transaction in a data server.
create function string rs_commit for sqlserver_derived_class output language 'execute rs_update_lastcommit @origin = ?rs_origin!sys?, @origin_qid = ?rs_origin_qid!sys?, @secondary_qid = ?rs_secondary_qid!sys?, @origin_time = ?rs_origin_commit_time!sys?; commit transaction'
/* Create a procedure to update the ** rs_lastcommit table. */ create procedure rs_update_lastcommit @origin int, @origin_qid binary(36), @secondary_qid binary(36), @origin_time datetime as begin update rs_lastcommit set origin_qid = @origin_qid, secondary_qid = @secondary_qid, origin_time = @origin_time, commit_time = getdate() where origin = @origin if (@@rowcount = 0) begin insert rs_lastcommit (origin, origin_qid, secondary_qid, origin_time, commit_time, pad1, pad2, pad3, pad4, pad5, pad6, pad7, pad8) values (@origin, @origin_qid, @secondary_qid,@origin_time, getdate(), 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) end end
The rs_commit function has function-string-class scope.
Replication Server creates an initial rs_commit function string for the system-provided function-string classes during installation.
If you use a user-created base function-string class, you must create an rs_commit function string.
Create or customize an rs_commit function string at the Replication Server that is the primary site for the class.
Update the rs_lastcommit system table in the rs_commit function string. Updating this table within the transaction maintains data integrity.