Skip to content

Conversation

@atomashpolskiy
Copy link
Member

@andrus , please approve

@andrus
Copy link
Contributor

andrus commented Apr 27, 2017

I guess I don't understand the point of "dryRun"

@atomashpolskiy
Copy link
Member Author

Kind of "preview" mode, that lets you inspect the changes without committing them.

@andrus
Copy link
Contributor

andrus commented Apr 27, 2017

If I understand correctly, the use case for this is to collect changes, and then handle them using custom code via a listener? I was hoping we can actually encapsulate @rzen 's case in a separate task that will not require a listener. Like "SoftDeleteTask"

@atomashpolskiy
Copy link
Member Author

Yeah, but my point is that it's not necessarily the only use case in which "undoing" of changes might be required.

One particular example would be a two-step user approval:

  • task is executed, and changes are accumulated in Cayenne context; nothing is committed
  • user inspects the changes (simple stats or more thorough per-attribute inspection)
  • user approves, and the changes are committed into target
    With this PR, all that is required to implement such use case would be to capture the ObjectContext. Which might also be exposed in some non-listener API...

Another use case is testing the jobs without actually committing anything. And stage listeners can inspect Execution.isDryRun() in order to prevent sending notifications or doing some other stuff.

@atomashpolskiy
Copy link
Member Author

In fact I'm not too strong on this one, so feel free to close if it seems to do more harm than good

@rzen
Copy link

rzen commented Apr 29, 2017

I think dry run is an interesting idea independent of my original request.

Even more useful if instead of in the code it could be enabled in extractor descriptor.

Something along the lines of:

 <config>
     <type>jdbc</type>
     <connectorId>connector</connectorId>
     <attributes>
     ...
     </attributes>
     <properties>
         <extractor.dryrun>true</extractor.dryrun>
         ...
     </properties>
 </config>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants