    [qbits.alia.manifold :as aliam]
    [qbits.hayt :as h]
    [er-cassandra.key :as k]
-   [er-cassandra.record :as r]
-   [er-cassandra.record-either :as re]
+   [er-cassandra.record-either :as r]
    [er-cassandra.model.types :as t]
    [er-cassandra.model.util :refer [combine-responses create-lookup-record]])
   (:import [er_cassandra.model.types Model]))

                        insert-response))

               live-ref? (if-not owned?
                           (re/select-one session
                                          (get-in model [:primary-table :name])
                                          (get-in model [:primary-table :key])
                                          (t/extract-uber-key-value

                 :else     [:fail key-desc :notunique] ;; someone else won
                 ))))))

(defn release-unique-key
  "remove a single unique key"
  [session ^Model model unique-key-table uber-key-value key-value]
  (let [uber-key (t/uber-key model)
        key (:key unique-key-table)
        key-desc {:uber-key uber-key :uber-key-value uber-key-value
                  :key key :key-value key-value}]
    (m/with-monad dm/either-deferred-monad
      (m/mlet [delete-result (r/delete session
                                        (:name unique-key-table)
                                        key
                                        key-value
