The idiomatic JDBC solution to this problem is a DataSource:
http://download.oracle.com/javase/6/docs/api/javax/sql/DataSource.html
http://bitbucket.org/kumarshantanu/clj-dbcp/src

A connection-pooling data source does exactly that - it recycles the
connection for many statements. The close() method of the Connection
doesn't really close it, but rather puts it back in the pool.

Regards
Shantanu

On Nov 16, 9:44 am, Daniel Bell <dchristianb...@gmail.com> wrote:
> I may be using the term wrong; while concurrency isn't necessary, I'm
> really just looking to minimize the # of times I'm opening/closing
> connections, but also looking to minimize unnecessary open
> connections.  I suspect what I'm really looking for is a macro to
> detect every instance of "(sql/with-connection" in a form, delete them
> all, and then wrap them in one with-connection form.  Which probably
> means I should get to writing it myself.  But if anyone knows of one
> already in existence, I'm all ears.
>
> Cheers,
>
> Daniel
>
> On Nov 13, 11:30 pm, Shantanu Kumar <kumar.shant...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Not sure what you meant by multiplexing? Did you mean "concurrent
> > execution" of SQL statements on the same connection?
>
> > Regards,
> > Shantanu
>
> > On Nov 14, 4:00 am, Daniel Bell <dchristianb...@gmail.com> wrote:
>
> > > I'm just getting my feet wet w/clojure's sql library, and I got to
> > > wondering---is multiplexing implemented in a library somewhere?  Or is
> > > it already part of contrib.sql but executed behind the scenes?
>
> > > Thanks,
>
> > > ---Dan

-- 
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

Reply via email to