On 2013-02-20, at 9:46 PM, James Reichley <jimmyqpub...@gmail.com> wrote:

> I can't find the reference now, but either in a screencast or a discussion I 
> read it was mentioned that if you have a single thing that performs 
> side-effects, you can perform this function last in the transaction without 
> worrying about any issues. The reasoning here is that if anything before it 
> fails, the side-effect action was never attempted and if the side-effect 
> action itself fails then the transaction rolls back like always.


Since you say 'side-effect' I'm assuming you're talking about STM transactions. 
If so, I don't see how this can be true. If some other thread can run while the 
side-effect is being created then that other thread has the ability to do 
something that causes your transaction to retry. Being the last thing done 
doesn't change this other than perhaps reducing its likelihood. The Clojure 
documentation is pretty clear about this: no side-effects. The Haskell version 
of STM is clear both in its documentation and it's STM implementation and type: 
no side-effects.

If you're talking about database transactions, just guessing but I'd think it 
depends on when/if locks are set.

Cheers,
Bob

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to