Why osv.TransientModel records and class fields stored in databases

Asked by Jacara

In 6.0 version. osv.osv_memory objects does not stored on databases. They has stored only memory. This logic helps let me have low space database.

But 6.1 version. osv.TransientModel objects always stored on databases. This logic growing my database. And i don't understand that who needed those memory records stored on database. And why?

Question information

Language:
English Edit question
Status:
Answered
For:
Odoo Server (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) said :
#1

Hi Jacara,

indeed the TransientModel is now stored in PostgreSQL tables, which are cleared periodically. This has a number of advantages: records of this type now operate transparently within the ORM, you can now actually search() records of this type, other operations should be a bit faster, and it helps to make the OpenERP server stateless (you can run multiple workers, or restart the OpenERP server and you can still continue any running wizard).

If you feel your tables grow too big, you can control the rate at which the tables are cleared with the
"_transient_max_count" or "_max_age" properties on your model.

Cheers,
Stefan.

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) said :
#2

Additionally, the model properties are taken from the following configuration options:

    osv_memory_count_limit
    osv_memory_age_limit

However, it looks like the rows may never actually get cleared because there is a logical error in the _transient_vacuum() method that is supposed to take care of this: the counter is cleared before it can reach the critical threshold of _transient_check_time. See [1].

You may have run into a bug!

Cheers,
Stefan.

[1] http://bazaar.launchpad.net/~openerp/openobject-server/trunk/view/head:/openerp/osv/orm.py#L4959

Can you help with this problem?

Provide an answer of your own, or ask Jacara for more information if necessary.

To post a message you must log in.