Michael Bayer ha scritto:
> id very much prefer a test case that isnt using Twisted since Ive no  
> idea what twisted does with threads.  

Well, all we need to know, in this example, is that the queries are 
executed always in one separate thread (and always the same).

So, the cursors (ResultProxy) are always created in thread B and used 
(and closed?) in thread A.

> it looks like the result proxy  
> is being shared between threads (which i believe is an effect of the  
> twisted reactor anyway?).
> 

Yes.
 From the documentation it is not clear if this is allowed.

The code, as an example, does not works with SQLite.
In PostgreSQL cursors are not thread safe, however I do not understand 
where the problem is.
Maybe the cursor is closed two times (in thread A and B)?

> if youre playing with threads to that degree the "threadlocal"  
> strategy may be too simplistic.
> 

Well, in production I *never* share the ResultProxy.



Thanks and regards  Manlio Perillo

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to