 (ns com.puppetlabs.cmdb.scf.storage
-  (:import (com.jolbox.bonecp BoneCP BoneCPConfig))
+  (:import (com.jolbox.bonecp BoneCPDataSource BoneCPConfig))
   (:require [com.puppetlabs.cmdb.catalog :as cat]
             [com.puppetlabs.utils :as utils]
             [clojure.java.jdbc :as sql]
+            [clojure.contrib.logging :as log]
             [digest]))
 
 ;;;; REVISIT: This needs to source the configuration data from somewhere more

BoneCP is internally thread-safe, so no internal locking is required.

The global is initialized during servlet setup, and will be torn down
again during servlet destruction."}
  *bonecp*)

(defn- new-connection-pool-instance
  "Create a new connection pool for the SCF database, configured appropriately,

The database handle is only valid for the dynamic scope of the call,
so nothing should be returned that is bound to database results."
  [& forms]
  `(sql/with-connection {:datasource *bonecp*}
     ~@forms))
