> Maybe if the external commit
> can be delayed until the end of the transaction, when it is certain
> that the in-memory operations succeeded, it could work. I think this
> is the most promising way of implementing this.

This was my plan.  As near as I can tell, the current STM
implementation commits by
1) locking all the written refs
2) checking if the writes of the transactions are non-conflicting.  If
any conflict, retry the whole transaction
3) then writing to the refs
4) unlocking the refs

The idea is that between 3) and 4) you would attempt to commit any
external transactions.  If that requires a rollback, rollback the in-
memory transaction as well.  Similarly, if there are any conflicts in
2), rollback any external transactions.

> The STM guarantees ACI, external transactions are usually
> ACID, so there's a conceptual mismatch between the two. If you think
> about it, why would you want to have transactions between a transient
> and a durable resource ?

The idea is that there would be ACI gaurantees not just within the
STM, but also between the STM and the external resource.  This doesn't
imply any D properties on the in-memory structures.  The program would
have to manage that itself, say by reloading the necessary structure
from the external resource at start up for crash recovery.

>Also, XA resources must be prepared to handle
> the case of an "heuristic commit", when all resources confirmed the
> "prepare" stage, but not the final "commit". This situation does not
> exist with pure STM, so one would have to be aware of the risk and
> settle for less guarantees when using "composite" transactions.

Hurm.  True.  You would still have ACI within the in-memory
structures, but could have inconsistency between the in-memory
structures and the external resource.
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to