Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trigger without a transaction?

Is it possible to create a trigger that will not be in a transaction?

I want to update data on a linked server with a trigger but due to firewall issues we can't create a distributed transaction between the two servers.

like image 949
Ryan Avatar asked Oct 27 '25 05:10

Ryan


1 Answers

What you probably want is a combination of a queue that contains updates for the linked server and a process that reads data from the queue and updates the remote server. The trigger will then insert a message into the queue as part of the normal transaction. This data will be read by the separate process and used to update the remote server. Logic will needed in the process handle errors (and possibly retries).

The queue can be implemented with one or more tables.

like image 118
Curt Hagenlocher Avatar answered Oct 29 '25 20:10

Curt Hagenlocher