Commit Graph

68 Commits

Author SHA1 Message Date
Vo Minh Thu 418739cf3e [MERGE] cleaned some imports, removed some code for older python versions.
bzr revid: vmt@openerp.com-20120118160305-ucennaoqehjuut1z
2012-01-18 17:03:05 +01:00
Vo Minh Thu b5caa70b83 [IMP] tools: removed some functools functions (they were there for previous python versions).
bzr revid: vmt@openerp.com-20120118114109-txh1cjv503xautty
2012-01-18 12:41:09 +01:00
nicolas.bessi@camptocamp.com 8d826cc07d [IMP] database template in commande line, you can now use --db_template=my_template, default is template0
bzr revid: nicolas.bessi@camptocamp.com-20120117164940-i3g1zcu49x0g60t5
2012-01-17 17:49:40 +01:00
Florent Xicluna 40c1de87d8 [REF] remove unused import, always import literal_eval from tools.safe_eval.
bzr revid: florent.xicluna@gmail.com-20120115214214-0rjwn80choc9g0fs
2012-01-15 22:42:14 +01:00
Florent Xicluna 1156aee52a [FIX] discard closed connections. Restart not required anymore when connection is lost.
bzr revid: florent.xicluna@wingo.ch-20111117093335-6t16181mqt49z7bi
2011-11-17 10:33:35 +01:00
Olivier Dony e7601e68cb [MERGE] sync with latest trunk
bzr revid: odo@openerp.com-20110928211326-0e51q7zlw4h2528z
2011-09-28 23:13:26 +02:00
Olivier Dony e85f246469 [IMP] sql_db: auto-exception-logging can now be turned off per cursor, not only per query
bzr revid: odo@openerp.com-20110924015852-9vru7cdsmzbvault
2011-09-24 03:58:52 +02:00
Vo Minh Thu ad06d1ba56 [FIX] This complements commit 3511,
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-09-13 16:34:44 +02:00
Vo Minh Thu 6fdadb04f5 [IMP] tools.cache: added missing clean_caches_for_db replacement.
bzr revid: vmt@openerp.com-20110825124711-y2uckmvcoa0arz4h
2011-08-25 14:47:11 +02:00
Olivier Dony 8504e6158b [IMP] sql_db: default cursor = serialized, deprecate serialized_cursor, add doc
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-14 12:55:52 +02:00
Vo Minh Thu b5daffc115 [IMP] registry: whene deleting a registry, also delete its cache and cron.
bzr revid: vmt@openerp.com-20110713153521-isn9bllnggbxwi0z
2011-07-13 17:35:21 +02:00
P. Christeas cf6e623f7d API docs: settings file and titles at modules
bzr revid: xrg@linux.gr-20110623090357-nazly8vpfnw0iskr
2011-06-23 12:03:57 +03:00
P. Christeas 588552b52d sql_db: docstrings
bzr revid: xrg@linux.gr-20110623090312-afwjqqduqdtex017
2011-06-23 12:03:12 +03:00
Vo Minh Thu 2856d16912 [ADD] sql_db: show file/line where the cursor was closed
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-22 13:24:17 +02:00
Vo Minh Thu 7008aa3e0e [FIX] sql_db: connection pool created lazily.
- This is necessary to give a chance to change the config just after importing openerp.

bzr revid: vmt@openerp.com-20110421103125-3lv609wnu3vh2m4f
2011-04-21 12:31:25 +02:00
Vo Minh Thu 0e1186dd3d [REF] openerp.pooler/openerp.sql_db: cleaner dependencies:
- 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-04-20 16:14:07 +02:00
Vo Minh Thu 8fae3e7c6f [FIX] sql_db: use the config values later than at import time.
lp bug: https://launchpad.net/bugs/716715 fixed

bzr revid: vmt@openerp.com-20110308140449-5v883yms1z8dy23k
2011-03-08 15:04:49 +01:00
Vo Minh Thu f8572e5c60 [IMP] openerp python module.
- 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
2011-02-07 13:57:23 +01:00