Hi

2011/7/29 Ken Wesson <kwess...@gmail.com>

> On Fri, Jul 29, 2011 at 7:41 AM, László Török <ltoro...@gmail.com> wrote:
> > Hi,
> >
> > is there a way to execute multiple select queries on a table using
> clojureql
> > in a transaction?
> >
> > sg. like
> >
> >    (with-results [res1 query1
> >                         res2 query2]
> >        .. do sg)
> >
> > and res1 and res2 would be taken from a same consistent snapshot.
>
> If you run two separate queries, I expect the database server will see
> them as two separate transactions, and may interleave some other,
> mutating transaction between them, so they won't in that case be taken
> from a consistent snapshot.
>
> You'd need to have a single query to the DB, which will run as a
> single transaction, generate both res1 and res2. I'm not sure if that
> will always be possible; my SQL-fu is a little rusty.
>

Thanks, I mean I know how to do it with raw sql, was just wondering how to
do it with clojureql, if possible at all.

I'll probably resort to clojure.contrib.sql for now.



>
> --
> Protege: What is this seething mass of parentheses?!
> Master: Your father's Lisp REPL. This is the language of a true
> hacker. Not as clumsy or random as C++; a language for a more
> civilized age.
>
> --
> 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




-- 
László Török

Skype: laczoka2000
Twitter: @laczoka

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