>the pool doesnt actually know much about connections and just  
>receives a callable function to create them.  so, put whatever you  
>want into that callable.  its not going to work very well to have a  
>single pool return different kinds of connections, though.

Well, i am not planning to mix databases. Perhaps i am just looking for 
a list of database apis to use. I know of psycopg/2 which is my main use.
where can i get the rest of the list to put in pool.manage(X,..)

> OK, this also sounds like an idea you have, that you should probably
> try to implement on your own...it sounds totally different from the
> pool that is provided with SA.   you are free to make your own pool
> class that does whatever you need it to (either subclassing Pool,
> which is mostly generic, or just totally your own thing; the rest of
> SA doesnt really care); it can be used within a regular
> ComposedSQLEngine.  if you come up with some better ways to
> synchronize/block/etc., we'd be interested to see what it looks
> like.   the current pool implementation is trying to keep it as
> simple as possible for the vast majority of projects, which includes
> a handful of web frameworks (like, turbogears, pylons) for which its
> been working out mostly OK.

For now i decided to go with something simple until i'll have something
more tuned to my framework:
import gc
from sqlalchemy.pool import QueuePool
class BlockingQueuePool(QueuePool):
    def do_get(self):
        while True:
            try:
                return QueuePool.do_get(self)
            except TimeoutError:
                    gc.collect()

-- 
Regards,
        Tzahi.
--
Tzahi Fadida
Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info
WARNING TO SPAMMERS:  see at 
http://members.lycos.co.uk/my2nis/spamwarning.html

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to