democracyworks / datomic-toolbox

Datomic Utility Library
19 stars 0 forks source link

Retry transactions #11

Closed ericnormand closed 9 years ago

ericnormand commented 9 years ago

Add a function + macro for doing retries when a ConcurrentModificationException happens in datomic.

This function allows us to make atomic updates to a database. Currently, we have many non-atomic updates to the database. You can identify a non-atomic update because it:

If anything has modified the database between t0 and tn, this transaction data may be stale, yet still be recorded. For instance:

After two increments, page-view should be 102, but it's 101. This function, along with the database functions defined in #8, will help us make sure everything is counted.

Using this new function and the :transact database function, the corrected situation above will look like:

Two increments, and page-view is 102, which is correct!

There is an example in election-notification-works.

tie-rack commented 9 years ago

Why was this closed?

ericnormand commented 9 years ago

I merged it together with the related branch with the transaction functions.

On Thu, Sep 10, 2015 at 8:38 AM, Christopher Shea notifications@github.com wrote:

Why was this closed?

— Reply to this email directly or view it on GitHub https://github.com/democracyworks/datomic-toolbox/pull/11#issuecomment-139236759 .