I have a table that acts like a queue (let's call it queue
) and has a sequence from 1..N
.
Some triggers inserts on this queue
(the triggers are inside transactions).
Then external machines have the sequence number and asks the remote database: give me sequences greater than 10
(for example).
The problem:
In some cases transaction 1 and 2 begins (numbers are examples). But transaction 2 ends before transaction 1. And in between host have asked queue
for sequences greater than N
and transaction 1 sequences are skipped.
How to prevent this?