On Jun 14, 2006, at 4:46 AM, Huy Do wrote:

>
> sqlalchemy.exceptions.InvalidRequestError: This transaction is  
> inactive
>

this bug is fixed in changeset 1614.  youre still going to get an  
exception, but the extra rollback() youre doing wont fail so youll be  
able to see what the real exception is.

> a. Does flush() affect nested transactions at all (assuming they  
> are all
> on the same session) ?

flush() uses its own begin()/commit() pair, but if there is already a  
transaction in progress then that begin()/commit() is part of the  
larger transaction and the flush() wont affect it.

> b. Can different sessions participate in the same transaction ?

if it makes you feel any better, no this is not documented at all and  
it wasnt obvious to me what the answer is.  anyway, yes it can sort  
of do this but its not particularly simple, as this use case was not  
considered with the current API .  if you use an engine with  
"strategy='threadlocal'" its easier (but then, more mysterious), or  
if you monkey around with multiple SessionTransactions and point them  
all to the same Connection...but if youre already confused then this  
is going to be even more confusing.

why do you need multiple sessions in one transaction ?



_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to