I have got a question about the Clojure ensure and how it actually
works and the documentation doesn't provide enough information.

I see a few different solutions:

1) An optimistic approach: Once a ref is 'ensured' it is included in
the conflict detection set. This means that the approach is still
completely optimistic because 2 concurrent transactions that have the
same ensured ref, one of them is going to fail when the transaction
wants to commit. This is a commit time ensure.

2) The other approach is a more pessimistic approach where a ref can
be protected against writes made by other transaction as soon as it is
ensured. It still allows reads to happen, but a write/ensure is going
to fail. It could be compared to a oracle 'select.. for update'. This
is an encounter time ensure.

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