Re: [sqlalchemy] Resource closed error when trying to insert the record in table randomly

2019-08-15 Thread Jonathan Vanasco
some situations that may be screwing up the connection pool like this include (and are not limited to): * your application may not be properly closing, resetting or returning a connection when there is an exception; * multiple threads/processes are using the same connection because of how it

Re: [sqlalchemy] Resource closed error when trying to insert the record in table randomly

2019-08-15 Thread Mike Bayer
On Thu, Aug 15, 2019, at 1:09 PM, Abhishek Sharma wrote: > Thanks Mike for your response. > > It's more likely due to multi threading because this error is coming very > randomly, If this was due to permutations you mentioned then it should happen > every time which is not the case here. > >

Re: [sqlalchemy] Resource closed error when trying to insert the record in table randomly

2019-08-15 Thread Abhishek Sharma
Thanks Mike for your response. It's more likely due to multi threading because this error is coming very randomly, If this was due to permutations you mentioned then it should happen every time which is not the case here. Any recommendations for handling sessions in multithreading? --

Re: [sqlalchemy] Resource closed error when trying to insert the record in table randomly

2019-08-15 Thread Mike Bayer
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

Re: [sqlalchemy] Resource closed error when trying to insert the record in table randomly

2019-08-15 Thread Abhishek Sharma
Thanks Mike for your reply. We are using cx Oracle as driver -- 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

Re: [sqlalchemy] Resource closed error when trying to insert the record in table randomly

2019-08-15 Thread Mike Bayer
On Thu, Aug 15, 2019, at 10:28 AM, Abhishek Sharma wrote: > One of my project is built around Django rest framework and Sqlalchemy as ORM. > > This application is thread based so randomly we are seeing one of thread > transaction showing connection closed error. > > Randomly when my

[sqlalchemy] Resource closed error when trying to insert the record in table randomly

2019-08-15 Thread Abhishek Sharma
One of my project is built around Django rest framework and Sqlalchemy as ORM. This application is thread based so randomly we are seeing one of thread transaction showing connection closed error. Randomly when my application is trying to insert the record in table we are seeing exception the