On Feb 10, 2009, at 10:01 PM, Eric Lavigne wrote:
Why can't I use ensure inside of a dosync block? Is there another way to perform a transaction?
You can, but "map" is lazy. It's not being evaluated within the dosync. One way to fix the code is to force map to evaluate within the dosync using "dorun":
(dosync (dorun (map ensure [account1 account2]))) See (doc dorun) for some more info. For a simple demo (for others), you might want to stick with: (ensure account1) (ensure account2) --Steve
smime.p7s
Description: S/MIME cryptographic signature