On Thu, 2004-06-10 at 14:47, Bruno Wolff III wrote:
> I think the real problem is that the original poster needs to precisely
> define what determines order. If the precise definition is transaction
> commit order, I think that is going to be hard to do exactly right.
Yes, that is what I want. So I can guarantee that the order of the IDs
in the database will be the same as the order in which they are taken
out of the queue.
I think I've come up with a reasonable solution now though. I can lock
the record representing the queue in another table FOR UPDATE and then
do the insert, then no other process will be able to gain that lock
until I complete. Best bit is other items can still insert concurrently,
but only one per queue, which is exactly what I was after.
Thanks for the help anyway ;-)
James