Uploaded image for project: 'Causeway'
  1. Causeway
  2. CAUSEWAY-1860

CommandReification.DISABLED is broken / incorrectly documented.

    XMLWordPrintableJSON

Details

    • Documentation
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.16.0
    • 1.16.1
    • None
    • 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

            danhaywood Daniel Keir Haywood
            danhaywood Daniel Keir Haywood
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: