Home » Eclipse Projects » Remote Application Platform (RAP) » Jobs cancelled by JobManagerAdapter?(Jobs cancelled by JobManagerAdapter?)
Jobs cancelled by JobManagerAdapter? [message #792681] |
Tue, 07 February 2012 09:19  |
Steffen Gieseler Messages: 7 Registered: February 2012 |
Junior Member |
|
|
We are using RAP 1.3 R2.
We extensively use jobs for doing background work. Every now and then, it seems without any regular pattern, some jobs are cancelled and cannot be restarted from the GUI, they immediately go back to the CANCEL state.
After some investigation, we found one class that might explain this, but there may be other reasons too: The JobManagerAdapter works with the session management in order to cancel any jobs when their correponding session has expired. Additionally, the JobManagerAdapter adds a listener (JobCanceler()) to that job such that any callback, including scheduled(), immediately cancels the job. However, the error cannot be reproduced reliably.
So here are our questions:
# Is this the real cause for the problem?
# Is it the only cause for the problem?
# How can we schedule a job such that it will never be cancelled, even when the associated session times out? Ideally, we would like to schedule a job that is not associated with a session at all!
Many thanks and best regards,
BitCtrl
|
|
|
Re: Jobs cancelled by JobManagerAdapter? [message #794630 is a reply to message #792681] |
Thu, 09 February 2012 14:16   |
Ivan Furnadjiev Messages: 2413 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Hi Steffen,
currently, all jobs are bound to a session in RAP. If you want to
execute something out of a session just use a background thread directly.
Best,
Ivan
On 2/7/2012 11:19 AM, Steffen Gieseler wrote:
> We are using RAP 1.3 R2.
>
> We extensively use jobs for doing background work. Every now and then,
> it seems without any regular pattern, some jobs are cancelled and
> cannot be restarted from the GUI, they immediately go back to the
> CANCEL state.
>
> After some investigation, we found one class that might explain this,
> but there may be other reasons too: The JobManagerAdapter works with
> the session management in order to cancel any jobs when their
> correponding session has expired. Additionally, the JobManagerAdapter
> adds a listener (JobCanceler()) to that job such that any callback,
> including scheduled(), immediately cancels the job. However, the error
> cannot be reproduced reliably.
>
> So here are our questions:
> # Is this the real cause for the problem?
> # Is it the only cause for the problem?
> # How can we schedule a job such that it will never be cancelled, even
> when the associated session times out? Ideally, we would like to
> schedule a job that is not associated with a session at all!
>
> Many thanks and best regards,
> BitCtrl
--
Ivan Furnadjiev
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
Re: Jobs cancelled by JobManagerAdapter? [message #796769 is a reply to message #792681] |
Sun, 12 February 2012 14:35   |
Rüdiger Herrmann Messages: 335 Registered: July 2009 |
Senior Member |
|
|
Steffen,
when a Job is scheduled, the the JobManagerAdapter tries to bind it to
the session/display that it is started on. This binding happens if
a) the Job is an instance of UI Job or
b) there is a request-service-context available. The thread that serves
the request is equipped with such a context.
Scheduling a Job without binding it to any session is currently only
possible with a hacky workaround. You'll have to create a thread (or
Job) that just starts the session-independant job. This way the
scheduling thread has no request-service-context attached and the
JobManagerAdapter doesn't find any session to bind the Job to.
Please feel free to file an enhancement request [1] for properly
expressing whether Jobs should be bound to a session or not (maybe by
using Job#setProperty).
HTH
Rüdiger
[1] http://eclipse.org/rap/bugs
On 07.02.2012 10:19, Steffen Gieseler wrote:
> We are using RAP 1.3 R2.
>
> We extensively use jobs for doing background work. Every now and then,
> it seems without any regular pattern, some jobs are cancelled and cannot
> be restarted from the GUI, they immediately go back to the CANCEL state.
>
> After some investigation, we found one class that might explain this,
> but there may be other reasons too: The JobManagerAdapter works with the
> session management in order to cancel any jobs when their correponding
> session has expired. Additionally, the JobManagerAdapter adds a listener
> (JobCanceler()) to that job such that any callback, including
> scheduled(), immediately cancels the job. However, the error cannot be
> reproduced reliably.
>
> So here are our questions:
> # Is this the real cause for the problem?
> # Is it the only cause for the problem?
> # How can we schedule a job such that it will never be cancelled, even
> when the associated session times out? Ideally, we would like to
> schedule a job that is not associated with a session at all!
>
> Many thanks and best regards,
> BitCtrl
--
Rüdiger Herrmann
http://codeaffine.com
|
|
| | | | | |
Goto Forum:
Current Time: Sun Jun 04 06:37:47 GMT 2023
Powered by FUDForum. Page generated in 0.02272 seconds
|