Is there a safe way to keep the data in a Clojure ref and the data in a table in an external (e.g. mysql) database in sync, given concurrent creates/updates/deletes from within Clojure?
I can't do a DB update from within a dosync because of retries. If I send-off an agent for the DB update from within a dosync, it won't happen until after the dosync is done, and then if the DB update throws an exception, it'll be too late to rollback the ref and they'll be out of sync. If I do the DB update and ref update separately, there's the potential for race conditions if things happen in between. Is manual locking the only way? --~--~---------~--~----~------------~-------~--~----~ 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---