Hi Slobodan,
Firstly, your snippet works for me (if I substitute meaningful stuff for your placeholders), and should work -- the inner with-db should open (or fetch from the pool) a fresh connection, that can be used even while the outer connection is processing a query (doquery will run its body while the database is returning the result rows). I tested against PostgreSQL 9.0.
So, since you don't really describe what kind of error you are getting, you'll have to be more specific (maybe give me a full example, including tables and some test data) for me to be able to debug this.
Best, Marijn