QuartzSchedulerService is started in the SessionPerPInstanceBean.start. The problem with this approach is that starting the QuartzSchedulerService will also try to immediately load a KBase if a timer was fired during the time the system was down.
As outlined in BaseKnowledgeSessionBean, one of the reasons to not immediately load the KBase on startup is because the Guvnor system might not have been initialized yet, which causes the kbase to not correctly load. This could for example cause the system to fallback to an empty kbase.
Therefore, the QuartzSchedulerService should wait until the system has been properly initialized. One of the problems is that, due to the way the current systems loads the kbase (in BaseKnowledgeSessionBean), we actually don't know when the system has been properly initialized. I.e if Guvnor was not yet available, a fallback to loading the KBase from filesystem might have occurred, which we can't check. So, in order to properly implement this, we ideally want to have issue #34 fixed.
We could implement starting the SchedulerService after proper startup and loading of the KBase via EJB3 async methods which would scan for a proper loading of the KBase before starting the scheduler.
QuartzSchedulerService is started in the SessionPerPInstanceBean.start. The problem with this approach is that starting the QuartzSchedulerService will also try to immediately load a KBase if a timer was fired during the time the system was down.
As outlined in BaseKnowledgeSessionBean, one of the reasons to not immediately load the KBase on startup is because the Guvnor system might not have been initialized yet, which causes the kbase to not correctly load. This could for example cause the system to fallback to an empty kbase.
Therefore, the QuartzSchedulerService should wait until the system has been properly initialized. One of the problems is that, due to the way the current systems loads the kbase (in BaseKnowledgeSessionBean), we actually don't know when the system has been properly initialized. I.e if Guvnor was not yet available, a fallback to loading the KBase from filesystem might have occurred, which we can't check. So, in order to properly implement this, we ideally want to have issue #34 fixed.
We could implement starting the SchedulerService after proper startup and loading of the KBase via EJB3 async methods which would scan for a proper loading of the KBase before starting the scheduler.