On Sun, Feb 8, 2009 at 12:23 PM, Anand Patil <
anand.prabhakar.pa...@gmail.com> wrote:

>
> Hello again,
>
> In my application, I'll frequently want to quickly discard all the
> changes made during a transaction involving many refs. I don't want to
> force the refs to roll back to their values at the beginning of the
> transaction, I just want to end the transaction immediately and skip
> the write stage; updates made in other transactions should still
> 'stick'. What's the most efficient way to do this?
>
> Thanks again!
> Anand
>

You can abort a transaction by throwing an exception, but in that case all
refs automatically retain their pre-transaction values. You can't partially
roll back a transaction, because by definition all changes to refs in a
transaction occur or none do.

By the way, what do you mean by "other transactions"?
  - Transactions running on other threads? Aborting in one thread does not
affect refs in other threads.
  - Transactions that completed earlier in time on the same thread? Those
values are not affected by aborting a later transaction.
  - dosync calling dosync on the same on the same thread? Aborting from an
inner dosync aborts the whole stack of dosyncs in that thread.

--~--~---------~--~----~------------~-------~--~----~
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
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