We had a similar issue while recently using background service. Our case
was using background service to invoke an action in background from an
foreground action in a domain service as menu. It throws an exception that
Command could not be inserted because of a null value set in a non-null
field. From what I remember, it was the identifier field from the parent
(foreground action) that was set to null. The identifier for the background
action was set correctly though.

I didn't have the time to investigate further but we initially made a
conclusion that command reification works on actions in domain objects, at
least.

Best regards,
Willie

On Sat, Apr 9, 2016 at 11:21 PM, Dan Haywood <[email protected]>
wrote:

> Just use the simpleapp archetype and add in the minimal amount of stuff
> needed to demonstrate the issue.
> Thx,
> Dan
> On 9 Apr 2016 16:05, "Igor Lobanov" <[email protected]>
> wrote:
>
> > Sure, although I need an advice on how to best approach it. Is there an
> > easy way of bootstrapping Isis as a standalone app using HSQL or
> something
> > similar?
> >  -- Best regards, Igor Lobanov
> >
> >     On Saturday, 9 April 2016, 15:33, Dan Haywood <
> > [email protected]> wrote:
> >
> >
> >
> >  That does sound like an issue. Probably the issue is in the addons
> > implementation rather than in Isis "proper", so will a bit easier to
> > release a fix if that is a problem.
> >
> > Could you put together a simple example on github that demonstrates the
> > problem, and document on its README how to reproduce?
> >
> > Thx,
> > Dan.
> > On 9 Apr 2016 15:28, "Igor Lobanov" <[email protected]>
> > wrote:
> >
> > 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
> >
> >
> >
> >
>

Reply via email to