Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Managament
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Producție
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

Is there lifecycle documentation for the cache layer (v9)

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
ormcachewebservices
1 Răspunde
5117 Vizualizări
Imagine profil
Rik Vermeer

I've integrated several remote webservices into our Odoo EE v9.

My goal is:

  1. to call the webservice on create (so after the ORM grants authorization).

  2. call the remote service only once, not more.

  3. if this call succeeded before? return existing record.

  4. [optionally] work on a separate transaction to avoid unnecessary rollbacks.

I've created two flavors:

  • create -> call webservice

  • create -> do nothing until -> read computed field (stored/rw) -> call webservice

Both methods end up in an uncontrollable entanglement of computations and recomputations. This happend majorly inside the cache layer and I can't unravel what's happening when. Sometimes it calls 3 times, sometimes more. Sometimes I open a parent and recomputations happen eventhough store=True. I've also tried with env.norecompute.

Is there anyone who holds some kind of lifecycle documentation on the cache? Does cache gets written by convert_to_cache on a field (and on a record)? What happens when cache gets invalidated? How can I use a computed stored field that calculates exactly once? These are all questions I can't find an answer to, even though I have put a lot of effort in them.


Regards,

Rik


p.s. Some interesting "closer to the cache" tech docs from Raphael Collet:

https://www.odoo.com/nl_NL/slides/slide/advanced-features-of-the-api-206

https://www.odoo.com/nl_NL/slides/slide/how-to-optimize-the-performance-229/pdf_content

0
Imagine profil
Abandonează
Imagine profil
Raphael Collet (rco)
Cel mai bun răspuns

Dear Rik,

The scenario you describe is confusing to me...

  • What does the data model on which you call create() represent?

  • You mention a computed field that gets recomputed.  What is that field?  What value does it store?  What is the link between that field and the webservice?

  • What kind of remote webservice do you use?  You wrote is should be called only once.  But is it once for all, once per server instance, once per request?

The "cache" you mention is the record cache.  It is a caching layer between the database and the record objects.

  • It is essentially a mapping from a pair (record, field) to a value.

  • The cache is written explicitly by field assignments like record.name = "foo", or implicitly by a prefetching mechanism that reads data from the database when you access a field like record.name.

  • A cache entry (record, field) is invalidated automatically when that field is modified in the database, or when dependencies of the field have been modified (this forces its recomputation).

  • It is used both for performance (minimize the number of queries to read data from the database), and to memoize the result of computed fields.

  • The cache is attached to a transaction (JSON/RPC request), and is dropped at the end of the transaction.  It is therefore not shared across transactions.

Regards,

Raphael

0
Imagine profil
Abandonează
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
(^_-)Contacto~Volaris~Directo(-_^)¿Cómo hablar directamente en Volaris?
webservices
Imagine profil
0
oct. 25
7
Cache problem
cache
Imagine profil
0
iul. 23
3060
Query caching Rezolvat
orm cache query odoo caching
Imagine profil
Imagine profil
1
iun. 25
11874
Where is my design on website of odoo stored?
webservices
Imagine profil
Imagine profil
Imagine profil
2
oct. 21
4345
ORM Relationship in Odoo 12
orm
Imagine profil
0
sept. 19
98
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now