On Fri, Dec 4, 2009 at 7:40 PM, Luc Préfontaine <lprefonta...@softaddicts.ca
> wrote:

>  I was about to say that. There's no need for the id's to be "contiguous",
> only to get them to grow to preserve ordering.
> If you can find a way in your design to increment the atom each time a
> transaction is retried then you would
> preserve ordering.
>

"(swap! the-atom inc)" immediately after the "(dosync"  ought to do it. I
just tested it and atom swaps are not rolled back if a transaction is
retried. (Agent sends are held until a transaction succeeds).

On the other hand it has to be before any (ensure a-ref) or similar
transaction-associated things within the dosync, as the transaction can
apparently abort at such points and the atom might therefore not get bumped
unless the swap comes earlier.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to