sql_db missing "temporary" cursors

Bug #781297 reported by xrg
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Confirmed
Wishlist
OpenERP's Framework R&D

Bug Description

In sql_db.py, each time we ask for a connection to a database (dsn, to be more exact), the ConnectionPool there picks one of the available ones or creates a new. When we are finished (ie. close and free the cursor), it puts the connection back into the pool (but keeps it open).
This means that we _cannot_ have a method to poll a db (ie. connect, query, disconnect). This is needed in some cases, where we need to see if a db is valid to use. Example, in ftp/webdav or other "service" addons, we list the dbs and then look inside them for the appropriate settings, to see if we can use them.

Results: we end up holding unnecessary connections to idle dbs, or even block buildbot from dropping them.

Recommended solution: write a method in sql_db.py, which will fetch a cursor with "temporary" behavior. If the cursor had come from the pool (ie. was open before), it will go back there. If not, it will freed and the connection closed. This will be an API enhancement, backwards compatible.

Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.