All, I am running business logic in background using Quartz. To that end I am extending AbstractIsisSessionTemplate in my job classes and overriding doExecuteWithTransaction() to do something useful, so far so good. Now I need to schedule some actions to be executed in the background outside the main scheduled job. This is because spawned tasks themselves may fail, but it must not cause the main job to fail as well. The project makes use of isis-module-command addon to schedule background commands from the UI, so I went on and wrote a logic that calls BackgroundService#execute(...) in the job code. Apparently this doesn't work, as I'm getting a few 'cannot insert null into non-null column' when CommandJdo INSERTs are being flushed. It is difficult for me to work out what the problem is by reading the code, but it seems that BackgroundService#execute(...) assumes invocation from the context of another parent command, which apparently is not so when the code is running in a background thread.
Ideally, I want to make use of BackgroundService#execute(...) rather than building something custom. Is there a particular way to invoke it from a background thread aside from AbstractIsisSessionTemplate#doExecuteWithTransaction()? Do I need to 'spoof' a parent command somehow? I would appreciate any suggestion. -- Best regards, Igor Lobanov
