Re: [sqlalchemy] result.close() : necessary in both insert and fetch ?

2014-09-22 Thread Milind Vaidya
I put a check in the method to check if the rows are being returned, if so I am extracting the rows and calling result.close(). For Insert I am banking on default close() call. Which solved my problem. On Monday, September 22, 2014 4:39:17 PM UTC-5, Michael Bayer wrote: > > > On Sep 22, 2014, at

Re: [sqlalchemy] result.close() : necessary in both insert and fetch ?

2014-09-22 Thread Michael Bayer
On Sep 22, 2014, at 4:21 PM, Milind Vaidya wrote: > > In simple words my application is doing following thing, > > There are 'n' tracks (some entity in business logic context) > every 5 mins per track have a thread--->each thread will spawn 5 threads per > mins--> now each of these threads wi

Re: [sqlalchemy] result.close() : necessary in both insert and fetch ?

2014-09-22 Thread Michael Bayer
On Sep 22, 2014, at 12:14 PM, Milind Vaidya wrote: > HI > > I have following code, > > > > > @db_error_handler > def execute_query(self, query_str, data=None): > '''Execute DB query and retry for common DB interaction errors''' > errors_concerned = [1213, 1205, 2013

[sqlalchemy] result.close() : necessary in both insert and fetch ?

2014-09-22 Thread Milind Vaidya
HI I have following code, @db_error_handler def execute_query(self, query_str, data=None): '''Execute DB query and retry for common DB interaction errors''' errors_concerned = [1213, 1205, 2013, 2006] attempts = 1 while(True): try: