> > yes but, if the connection is recycled, a new session is created for the > same connection, > Depends what "recycled" means. I thought the idea of a pool_size was that the session is reused, saving on database login time. the code in ConnectionPool.reconnect() implies that the pool keeps open existing connections (& cursors ?) self.connection = POOL[uri].pop() Did you mean cursor instead of session ?
> A new cursor is created when a connection is recycled (pool_size>0). > > Yes, I can see that in self.cursor = cursor and self.connection.cursor() > This is possible. We close the connection (when necessary) but I do not >> think there is a concept of closing a cursor. How would you close it on >> Teradata? >> > > Teradata is using pyodbc, and it is possible to do cursor.close(), as well as connection.close(). http://code.google.com/p/pyodbc/wiki/Cursor . What I think is happening is that each new request is creating a new cursor, possibly with existing connections from the pool. At the end of the request the cursor is not closed and stays open. After a few requests the number of cursors builds up for the connection, and pretty soon the 16 cursor limit is reached. I think what is missing is that at the end of a request there should be a self.cursor.close(), or for the DAL: self._adapter.cursor.close(). Where is dal.py does a connection get returned to the pool when the request is finished ? Given that a connection is meant to have a single curror, in the case of pyodbc, should methods like commit, rollback, and close be at the cursor level, not the connection level ? I think a workaround is to not set pool_size, thereby getting a new session with only one cursor each time, but this will be a lot slower. Sorry if this has turned into more of a developer post. Thanks Andrew W -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.