Ticket #1830 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

DataModel/Adapters should write only what's necessary

Reported by: gracinet Assigned to: gracinet
Priority: P1 Milestone: CPS 3.4.4
Component: CPSSchemas Version: TRUNK
Severity: major Keywords:
Cc:

Description

DataModel? has the concept of dirty field: a field whose value has been changed and therefore must be written. In CPS <= 3.4.3, this is used only to avoid heavy computations, like transforms. It is necessary to avoid writing non-dirty fields. Use-cases:

  • Some read expressions can be used to derive data from another source (a parent folder, for instance). This data should not be stored if we want it to stay dynamically in sync with the source. write_ignore_storage is not a valid option when we want further the user to be able to manually update it
  • In MetaDirectory?, if a backend is read-only, this directly avoids writing to said backend.
  • Overall performance issues with distant sources.

In [50922] and followers in CPSSchemas and CPSDirectory, this was implemented by simply restricting what's being sent to adapters. Unfortunately, this is not good enough, because adapters take care of write expressions, and some of these might need both dirty and unchanged fields. This breaks for instance editing of user entries in some ldap setups because cross-sets neeed the unchanged used ids to write in groups directory.

The adapters should be passed the full data and indication of what has to be written.

Change History

04/16/07 11:37:15 changed by gracinet

Done [51533], [51534]. There is a new concept of "write_dependent_fields". Some BBB has been set in order not to break third party storage adapters in which _setData is overriden (these should be nonetheless updated).

Now testing...

04/18/07 14:20:04 changed by madarche

  • status changed from new to closed.
  • resolution set to fixed.

It is confirmed that it doesn't break anything.