Re: Preferred way of binding jdbc connections

2013-08-29 Thread Lyn Headley
Hi Shantanu, that was perfect, thanks. I note that this article only deprecates dynamic scoping in libraries, so my conclusion is that what I am considering is not an antipattern. Indeed, Stuart Sierra says the same: "Applications can manage their own resources, and only the application program

Re: Preferred way of binding jdbc connections

2013-08-28 Thread Shantanu Kumar
Hi Lyn, Dynamic vars for resource sharing is not a favored approach due to performance and several other reasons. This blog post explains it well: http://stuartsierra.com/2013/03/29/perils-of-dynamic-scope Shantanu On Thursday, 29 August 2013 07:21:46 UTC+5:30, Lyn Headley wrote: > > Hello, if

Preferred way of binding jdbc connections

2013-08-28 Thread Lyn Headley
Hello, if I want to run some sql code in a transaction, I can do this (where clojure.java.jdbc is referred to as j): (j/db-transaction [conn dbspec] use conn here But if I have a function I want to call from this transaction, say to do a query, then I need to pass in the connection to that fun