title: Reload a val in clojure
body: <p>I have a datomic connection value defined alongside some helper functions:</p>
  
  <pre><code>(def uri "datomic:dev://localhost:4334/dab")
  
  (defn delete-db [] (d/delete-database uri))
  (defn create-db [] (d/create-database uri))
  
  (def conn (d/connect uri))
  </code></pre>
  
  <p>The problem is if I call delete-db and then create-db the connection in the "conn" value is dropped. So I need a way to be able to 'reload' the conn value after doing the delete/create cycle. Given the immutable nature of "def values" how can I do this?</p>
  
  <p>I came across this: <a href="http://www.rkn.io/2014/02/10/datomic-antipatterns-connnnn/" rel="nofollow">http://www.rkn.io/2014/02/10/datomic-antipatterns-connnnn/</a> which discusses the reasons not to use conn as a value, however it only makes sense when doing query. I am passing conn into function to do transactions.</p>