Just to follow up on this:

0.3.0-rc1 introduces with-db-connection to allow multiple operations
on a shared connection easily:

(with-db-connection [db-con db-spec]
  ... operate on db-con multiple times ...)

Sean

On Tue, Dec 10, 2013 at 4:06 PM, Sean Corfield <seancorfi...@gmail.com> wrote:
> On Tue, Dec 10, 2013 at 2:17 PM, Andrey Antukh <n...@niwi.be> wrote:
>> In my opinion, this has a lot of boilerplate for basic operation like this
>> (reuse a connection for few operations).
>
> I'm open to suggestions for idiomatic enhancements (via JIRA).
>
>> The deprecated api of clojure.java.jdbc had some useful methods for do it
>> more concise and intuitive, you can use it.
>
> The deprecated API relied heavily on dynamically rebound global
> variables which are poor style (which is _why_ that API is
> deprecated).
>
>> Also, you can try use a connection pool for avoid this boilerplate or find a
>> more concise alternative to clojure.java.jdbc library.
>
> I would certainly recommend using a connection pool. There are two
> examples of that in the (community-editable) docs:
>
> http://clojure-doc.org/articles/ecosystem/java_jdbc/home.html#how-to-use-connection-pooling
> --
> Sean A Corfield -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/
> World Singles, LLC. -- http://worldsingles.com/
>
> "Perfection is the enemy of the good."
> -- Gustave Flaubert, French realist novelist (1821-1880)



-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to