Hi,

This indicates that Cayenne was accessed after the stack shutdown. The only 
place that may happen in Bootique is when the entire app is stopped and 
ShutdownManager is called [1]. Also this should be an unrecoverable error, so 
after you see it once, all subsequent Cayenne operations would keep throwing 
it. So it appears that you start and stop the app every time the job is run 
(which is fine of course)? And the reason for the error may be that the app is 
shutdown while the job is still in progress. So how does the app command line 
look like?

(Also this message came to the list through moderation, meaning you are not 
subscribed and may miss some replies. Make sure to check the list archives for 
other replies).

Andrus

[1] 
https://github.com/bootique/bootique-cayenne/blob/d2630f3e1ff3a76f1f46a694fdefd8286a2d90fb/bootique-cayenne/src/main/java/io/bootique/cayenne/CayenneModule.java#L102


> On Sep 8, 2020, at 12:17 PM, Alexander Zapasnik <[email protected]> 
> wrote:
> 
> Hello everyone.
> 
> I have a bootique application which uses a 5 minute cron job to update DB
> via some rules.
> I've noticed that sometimes it throws DomainStoppedException.
> It is hard to reproduce it as it happens just a few times per day.
> 
> I can't get why this might happen. Any thoughts?
> 
> org.apache.cayenne.access.DomainStoppedException: [v.4.0 Aug 06 2018
>> 12:11:43] Domain project was shutdown and can no longer be used to access
>> the database
>>        at
>> org.apache.cayenne.access.DataDomain.checkStopped(DataDomain.java:181)
>> ~[cayenne-server-4.0.jar:4.0]
>>        at
>> org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:554)
>> ~[cayenne-server-4.0.jar:4.0]
>>        at
>> org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:406)
>> ~[cayenne-server-4.0.jar:4.0]
>>        at
>> org.apache.cayenne.util.ObjectContextQueryAction.executePostCache(ObjectContextQueryAction.java:107)
>> ~[cayenne-server-4.0.jar:4.0]
>>        at
>> org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:94)
>> ~[cayenne-server-4.0.jar:4.0]
>>        at
>> org.apache.cayenne.access.DataContext.onQuery(DataContext.java:965)
>> ~[cayenne-server-4.0.jar:4.0]
>>        at
>> org.apache.cayenne.access.DataContext.performQuery(DataContext.java:954)
>> ~[cayenne-server-4.0.jar:4.0]
>>        at
>> org.apache.cayenne.access.ToOneFault.doResolveFault(ToOneFault.java:81)
>> ~[cayenne-server-4.0.jar:4.0]
>>        at
>> org.apache.cayenne.access.ToOneFault.resolveFault(ToOneFault.java:54)
>> ~[cayenne-server-4.0.jar:4.0]
>>        at
>> org.apache.cayenne.CayenneDataObject.readProperty(CayenneDataObject.java:180)
>> ~[cayenne-server-4.0.jar:4.0]
>>        at
>> org.apache.cayenne.CayenneDataObject.setToOneTarget(CayenneDataObject.java:357)
>> ~[cayenne-server-4.0.jar:4.0]
>> 

Reply via email to