   (:use [cavm.hashable :only (ahashable)])
   (:require [me.raynes.fs :as fs])
   (:require [cavm.db :refer [XenaDb]])
-  (:require [clojure.tools.logging :refer [spy trace info]])
+  (:require [clojure.tools.logging :refer [spy trace info warn]])
   (:require [taoensso.timbre.profiling :refer [profile p]])
   (:require [clojure.core.cache :as cache])
   (:require [cavm.h2-unpack-rows :as unpack])

     WHERE `dataset`.`id` = ?" id]
    (vec rows)))

(defn- with-load-status* [dataset-id func]
  (jdbcd/update-values :dataset ["`id` = ?" dataset-id] {:status "loading"})
  (try
    (func)
    (finally
      (jdbcd/update-values :dataset ["`id` = ?" dataset-id] {:status "loaded"}))))

(defmacro with-load-status [dataset-id & body]
  `(with-load-status* ~dataset-id (fn [] ~@body))) ; XXX need :^once?

; jdbcd/transaction will create a closure of our parameters,
; so we can't pass in the matrix seq w/o blowing the heap. We

    (-> rows first :id)))

(defn delete-dataset [dataset]
  (let [dataset-id (dataset-by-name dataset)]
    (if dataset-id
      (with-delete-status dataset-id
        (jdbcd/transaction
          (do
            (clear-by-exp dataset-id)
            (jdbcd/do-commands
              (format "DELETE FROM `dataset` WHERE `id` = %d" dataset-id)))))
      (info "Did not delete unknown dataset" dataset))))

(defn create-db [file & [{:keys [classname subprotocol make-pool?]
                          :or {classname "org.h2.Driver"
