Developing persistence applications
While you are writing the EPL code for your persistence application, use Apama Studio as you usually do and do not enable persistence. When your application is near completion and has been successfully tested, start testing execution of the onBeginRecovery() and onConcludeRecovery() actions you defined in your application. Do this as follows:
1. Select Run, Run configurations, Correlator component.
2. Add -P to the command line of the correlator.
3. Start the correlator.
4. In the Run configuration, Correlator component, Initialization tab, disable all checkboxes so that nothing is reinjected.
5. Stop and restart the correlator. It will have persisted the injected monitors.
6. Test the behavior of onBeginRecovery() and onConcludeRecovery() actions.
7. If everything is working correctly, you can stop here. Otherwise, modify your code and continue with the following steps.
8. Delete the persistence.db file.
9. In the Run configuration, Correlator component, Initialization tab, re-enable all checkboxes so that your code is injected.
10. Start again at step 3 and continue until your code is working as desired.
Ensure that you delete the persistence.db file and re-inject fresh monitors only when loss of all state is acceptable, for example, during testing.