summaryrefslogtreecommitdiff
path: root/openerp/sql_db.py
AgeCommit message (Collapse)Author
2013-04-04[MERGE] forward merge 7.0 until revision 4919.Vo Minh Thu
bzr revid: vmt@openerp.com-20130404130704-24vsmczw34cssytd
2013-03-27[REF] no longer use openerp.pooler.Vo Minh Thu
Either use openerp.modules.registry.RegistryManager when the full new() signature is needed, or use openerp.registry(). Replaced also some pool.get() with pool[] because KeyErrors are better than AttributeErrors on None. bzr revid: vmt@openerp.com-20130327111014-2i0hlvpy5y5ku7hm
2013-02-12[REM] Deleted .apidoc lines.Vo Minh Thu
They were probably used by some tools. How sad. bzr revid: vmt@openerp.com-20130212142410-zqdjd8jw3gtvxab0
2013-03-01[FIX] *: fix/rationalize db logging to avoid incorrect values during loggingOlivier Dony
The setting/clearing of the tracking were not done consistently, causing log messages that appeared to come from one database while coming from another one or none at all. The tracker is now set at the earliest points of request handling where we can: - in web client, when creating WebRequests (dbname, uid) - at RPC dispatching in server (uid) - at cron job acquisition in CronWorker (dbname) - at Registry acquisition in RegistryManager (dbname) The tracker is cleared at the very entrance of the request in the WSGI `application`, ensuring that no logging is produced with an obsolete db name. (It cannot be cleared at the end of the request handling because the werkzeug wrapper outputs more logging afterwards) bzr revid: odo@openerp.com-20130301120744-jfitcmze2jldecod
2013-02-19[REVERT] sql_db: undo eager removal of connections from pool; could skip ↵Olivier Dony
half the connections and is not strictly required Credit to Florent Xicluna for spotting it! lp bug: https://launchpad.net/bugs/905257 fixed bzr revid: odo@openerp.com-20130219102610-ll69qaf3zxem1pxf
2013-02-16[FIX] sql_db: immediately remove the connections from the pool when detected ↵Olivier Dony
to be dead lp bug: https://launchpad.net/bugs/905257 fixed bzr revid: odo@openerp.com-20130216011831-5ehi02j5nj6shh8n
2013-02-15[FIX] sql_db: only perform the connection reset when actually planning to ↵Olivier Dony
borrow that connection, not before, for obvious performance reasons bzr revid: odo@openerp.com-20130215161025-mjgmlju3zgs50zk7
2013-02-15[FIX] sql_db: typo in previous patch for autodetection of closed connectionsOlivier Dony
My bad, I did and undid this patch several times in different manners and ended up commiting the wrong one. lp bug: https://launchpad.net/bugs/905257 fixed bzr revid: odo@openerp.com-20130215151237-3ks21kfhjb2fvl2z
2013-02-15[FIX] sql_db: closing a closed connection is not allowed in psycopg2 2.4.4 ↵Olivier Dony
and earlier Having the connections automatically reaped by psycopg2 is not guaranteed to happen all the time, so we still need to take extra steps to forece-close them bzr revid: odo@openerp.com-20130215113751-12kwmfynyt43qs57
2013-02-14[FIX] sql_db: free dead database connectionsChristophe Simonis
lp bug: https://launchpad.net/bugs/905257 fixed bzr revid: chs@openerp.com-20130214135227-x6lzy3gj0s75ssmw
2012-12-14[REM] trailing semicolonsXavier Morel
bzr revid: xmo@openerp.com-20121214124310-wfdkhmcwxnyqu30m
2012-12-14[FIX] misplaced docstringsXavier Morel
bzr revid: xmo@openerp.com-20121214124243-kvg2cg00k0a4518p
2012-12-14[REM] unnecessary parensXavier Morel
bzr revid: xmo@openerp.com-20121214123803-6xu2s1ndnoyj4i3e
2012-10-15[FIX] res_users.login: fix query parameters in cr.executeRaphael Collet
bzr revid: rco@openerp.com-20121015100148-pkanx35vr6fqojuj
2012-09-24[ADD] cache dict on the cursor, for request-local repeated readsXavier Morel
bzr revid: xmo@openerp.com-20120924101404-cel6oy1akabbo7id
2012-02-06[MERGE] merged trunk.Vo Minh Thu
bzr revid: vmt@openerp.com-20120206203151-3snkz7usngwtv1xt
2012-02-02[IMP] logging: _logger.warn() replaced by _logger.warning().Vo Minh Thu
bzr revid: vmt@openerp.com-20120202092634-pylu3098p5c0mays
2012-02-02[IMP] logging: _logger.log(DEBUG) replaced by _logger.debug().Vo Minh Thu
bzr revid: vmt@openerp.com-20120202092105-mfufuv97h8zrc2n7
2012-02-01fix --log-sqlAntony Lesuisse
bzr revid: al@openerp.com-20120201002321-nstmlzxzrcfgev13
2012-02-01[FIX] drop database fails when done before connecting to server.Ronald Portier
lp bug: https://launchpad.net/bugs/924783 fixed bzr revid: ronald@therp.nl-20120201113759-wi2kogl2x1lsxk7g
2012-01-25[IMP] warnings: turn warnings.warn into logging.warning:Vo Minh Thu
Warnings are handled with the other logs (and not always sent to stderr), they also appear under a module __name__ channel instead of py.warn. The disadvantage is that there is no longer specific warnings, such as pending deprecation warning or deprecation warning. bzr revid: vmt@openerp.com-20120125132407-u33idc0qh7ecs1i5
2012-01-24[IMP] openerp.wsgi: _logger with fully qualified module name.Vo Minh Thu
bzr revid: vmt@openerp.com-20120124111438-730miqdcm3eljgds
2012-01-18[MERGE] cleaned some imports, removed some code for older python versions.Vo Minh Thu
bzr revid: vmt@openerp.com-20120118160305-ucennaoqehjuut1z
2012-01-18[IMP] tools: removed some functools functions (they were there for previous ↵Vo Minh Thu
python versions). bzr revid: vmt@openerp.com-20120118114109-txh1cjv503xautty
2012-01-17[IMP] database template in commande line, you can now use ↵nicolas.bessi@camptocamp.com
--db_template=my_template, default is template0 bzr revid: nicolas.bessi@camptocamp.com-20120117164940-i3g1zcu49x0g60t5
2012-01-15[REF] remove unused import, always import literal_eval from tools.safe_eval.Florent Xicluna
bzr revid: florent.xicluna@gmail.com-20120115214214-0rjwn80choc9g0fs
2011-11-17[FIX] discard closed connections. Restart not required anymore when ↵Florent Xicluna
connection is lost. bzr revid: florent.xicluna@wingo.ch-20111117093335-6t16181mqt49z7bi
2011-09-28[MERGE] sync with latest trunkOlivier Dony
bzr revid: odo@openerp.com-20110928211326-0e51q7zlw4h2528z
2011-09-24[IMP] sql_db: auto-exception-logging can now be turned off per cursor, not ↵Olivier Dony
only per query bzr revid: odo@openerp.com-20110924015852-9vru7cdsmzbvault
2011-09-13[FIX] This complements commit 3511,Vo Minh Thu
revision-id: odo@openerp.com-20110714105552-9tgofrjtdgjmgc4b. Each OpenERP cursor is mapped to a single psycopg2 connexion. When a cursor is closed, the connexion is pushed back to a pool and reused later. Now that the 'snapshot isolation' level is used, the fact we didn't properly commit/rollback a transaction appears: some 'concurrent' update showed up. The fix is simple: whenever a cursor is closed, we rollback any pending operation (which is the expected behavior). (Furthermore, the connexion is explicitely closed when the connexion is pushed back but not kept in the pool.) bzr revid: vmt@openerp.com-20110913143444-s49r7r2h6m00p5s3
2011-08-25[IMP] tools.cache: added missing clean_caches_for_db replacement.Vo Minh Thu
bzr revid: vmt@openerp.com-20110825124711-y2uckmvcoa0arz4h
2011-07-14[IMP] sql_db: default cursor = serialized, deprecate serialized_cursor, add docOlivier Dony
In the context of OpenERP transaction, we really need the 'snapshot isolation' level provided by PostgreSQL because not being able to make repeatable reads within the same transaction is a very dangerous source of corrupted data, especially in a very concurrent system. The performance impact of switching from the default read_committed level to serializable/repeatable_read level has been measured and and was not distinguishable from the standard deviation - so it seems quite acceptable. User of PostgreSQL 9.1 might want to update to psycopg2 version 2.4.2 or later to properly use the regular snapshot isolation level, and not the newer, more expensive serializable level (see comments in Cursor docstring). bzr revid: odo@openerp.com-20110714105552-9tgofrjtdgjmgc4b
2011-07-13[IMP] registry: whene deleting a registry, also delete its cache and cron.Vo Minh Thu
bzr revid: vmt@openerp.com-20110713153521-isn9bllnggbxwi0z
2011-06-23API docs: settings file and titles at modulesP. Christeas
bzr revid: xrg@linux.gr-20110623090357-nazly8vpfnw0iskr
2011-06-23sql_db: docstringsP. Christeas
bzr revid: xrg@linux.gr-20110623090312-afwjqqduqdtex017
2011-04-22[ADD] sql_db: show file/line where the cursor was closedVo Minh Thu
This will be printed along the error message whenever an attempt to use a closed cursor is made (only in debug_sql log level). bzr revid: vmt@openerp.com-20110422112417-dbeqq4qm59sr2wvt
2011-04-21[FIX] sql_db: connection pool created lazily.Vo Minh Thu
- This is necessary to give a chance to change the config just after importing openerp. bzr revid: vmt@openerp.com-20110421103125-3lv609wnu3vh2m4f
2011-04-20[REF] openerp.pooler/openerp.sql_db: cleaner dependencies:Vo Minh Thu
- openerp.pooler no longer provides get_db_only, which is a provided by sql_db - openerp.sql_db does not rely anymore on netsvc, which is goog as it was making a circular import. The downside is that db_close callers have to clean also the Agent themselves. bzr revid: vmt@openerp.com-20110420141407-au0oanwjc0t15vy5
2011-03-08[FIX] sql_db: use the config values later than at import time.Vo Minh Thu
lp bug: https://launchpad.net/bugs/716715 fixed bzr revid: vmt@openerp.com-20110308140449-5v883yms1z8dy23k
2011-02-07[IMP] openerp python module.Vo Minh Thu
- Some logging code moved from netsvc.py to loglevels.py - Changed imports to use the new openerp module - config and netsvc initialization calls move to openerp-server.py - Moved openerp-server.py outside the old bin directory - Some imports in tools moved inside the methods to break mutual-dependencies bzr revid: vmt@openerp.com-20110207125723-ooee7d7ng5elmkso