Uploaded image for project: 'Isis'
  1. Isis
  2. ISIS-1860

CommandReification.DISABLED is broken / incorrectly documented.

    Details

    • Type: Documentation
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.16.0
    • Fix Version/s: 1.16.1
    • Component/s: None
    • Labels:
      None

      Description

      Don't intend to change the implementation, but what I observe is that setting commandReification=DISABLED does not necessarily prevent a command from being persisted.  All it does is prevent a CommandFacet from being installed on the corresponding action or property in the metamodel.

      A Command object is always created by CommandContext.  If there is a CommandService implementation, then it delegates to that to act as the factory of the Command.  So reification always occurs.

      If an action invocation or property edit causes objects to be modified, then the Command#setPersistHint(...) is set to true.  And, if there is no command facet, then the CommandServiceJdo will default the Command#setPersistence(...) to PERSIST_IF_HINTED.

      The net result is that if commandReification is DISABLED, then commands are still persisted if they cause any objects to be dirtied.  

      To prevent commands being persisted, instead use @Action(commandPersistence=NOT_PERSISTED), and make sure that @Action(command=ENABLED).

       

      object is updated with a persist hint.  In the case of the incode platform's Command module, the CommandService#complete(Command) is called, its implementation will 

        Attachments

          Activity

            People

            • Assignee:
              danhaywood Dan Haywood
              Reporter:
              danhaywood Dan Haywood
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: