On Thu, Aug 15, 2019, at 12:25 PM, Abhishek Sharma wrote:
> Thanks Mike for your reply.
> 
> We are using cx Oracle as driver


OK actually this error is very specific to the ORM session, it's from trying to 
a work witha transaction that's already done. It can be reproduced in many 
ways, such as:

from sqlalchemy.orm import Session

s = Session()

with s.transaction:
 s.commit()


or with autocommit:

from sqlalchemy.orm import Session

s = Session(autocommit=True)

with s.begin():
 s.commit()

or without a context manager:

s = Session()

trans = s.transaction
s.commit()
trans.commit()


or other permutations of that pattern. you're getting the exception on a flush, 
but the Session is in an invalid state with an operation like those above.

this is why it's easy for this issue to be due to multithreading. but it could 
just be a weird commit/rollback pattern. need to see the code.







> 
> -- 
> SQLAlchemy - 
> The Python SQL Toolkit and Object Relational Mapper
> 
> http://www.sqlalchemy.org/
> 
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> description.
> --- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/8bf92caa-aa5c-405c-9c3b-9e51ea7a9935%40googlegroups.com.
> 

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/03fe1b0c-d9f0-488f-a0db-0df7060e7237%40www.fastmail.com.

Reply via email to