You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Vamsi <va...@gmail.com> on 2007/01/08 07:46:36 UTC

Regarding Scheduled services

Hi everyone,
 I want know that "is there any possiblity that service scheduled will be
stopped"
 why i am asking this question is I had scheduled a service to run forever
it ran successfully for 10 days after that when I restarted the server one
of the service was not started .

regards
Vamsi 
-- 
View this message in context: http://www.nabble.com/Regarding-Scheduled-services-tf2937798.html#a8213433
Sent from the OFBiz - Dev mailing list archive at Nabble.com.


Re: Regarding Scheduled services

Posted by Chris Howe <cj...@yahoo.com>.
--- Vamsi <va...@gmail.com> wrote:

> 
> How I will know whether a service is running or not
> from JOBsandbox as it is
> give log and previous runs
> -- 

A service is scheduled to run if it has a run time in
the future and no start time or end time.
A service is running if it has a start time but no
finish time.
A service is complete if it has a start time and an
end  time.
Something fishy may be happening if the run time is in
the past and there was no start time or end time


To determine what happened to your particular service
that stopped rescheduling itself after ten days:
Go to webtools -> Entity Data Maintenance ->
Jobsandbox -> Fnd and fill in the name of your service
for the Jobsandbox.serviceName field.  You're likely
to find that there is quite a difference in elapsed
time between the runTime and the startTime.  This
would occur with the MySql lost connection that I
mentioned earlier.  

The reason being that when the connection was
terminated, it could not write the update to the
JobSandbox with the startTime or the endTime, so when
you reset your server or a new MySql connection was
made the jobPoller ran the service, but there would be
quite a time delay between it's scheduled time
(runTime) and when a new connection was made.

Re: Regarding Scheduled services

Posted by Vamsi <va...@gmail.com>.
How I will know whether a service is running or not from JOBsandbox as it is
give log and previous runs
-- 
View this message in context: http://www.nabble.com/Regarding-Scheduled-services-tf2937798.html#a8221527
Sent from the OFBiz - Dev mailing list archive at Nabble.com.


Re: Regarding Scheduled services

Posted by Chris Howe <cj...@yahoo.com>.
That may be the issue then.  If ofbiz's database
connection goes stale, which will occur after 8 hours
of database inactivity with MySql (it's a security
feature ;) )there is no way for the service to create
another record in the JobSandbox entity.  In our
deployment we run a service every three hours that
simply creates a record in an relatively unused entity
and then delete that record.  This may be of value to
add somewhere in the wiki, but with all of the
rearranging going on, I'm not sure where to put it.

This is the simple method that our service calls:

	<simple-method method-name="hitTheDatabase" 
short-description="store and delete an entry to keep
Mysql Database Alive">
		<make-value entity-name="GeoType"
value-name="hitEntity"/>
		<set field="hitEntity.geoTypeId"
value="XXXXXXXXXX"/>
		<create-value value-name="hitEntity"/>
		<entity-one entity-name="GeoType"
value-name="thisEntity">
			<field-map field-name="geoTypeId" 
env-name="hitEntity.geoTypeId"/>
		</entity-one>
		<remove-value value-name="thisEntity"/>
	</simple-method>



--- Vamsi <va...@gmail.com> wrote:

> 
> hi
> Thanks for responding
> I am Using Mysql database
> regards
> Vamsi
> 
> cjhowe wrote:
> > 
> > Services that are scheduled are registered in the
> > JobSandbox entity.  After they run, they
> reschedule
> > themselves as defined. So you may check there that
> > your scheduled service had the right field values.
> > 
> > If you are using MySql, it is possible that the
> > service runs because the start time might be
> > registered in cache but then when the service goes
> to
> > reschedule itself it cannot create the reschedule
> > entry because the MySql connection will close
> after 8
> > hours of inactivity. 
> > 
> > What database are you running?
> > 
> > 
> > --- Vamsi <va...@gmail.com> wrote:
> > 
> >> 
> >> Hi everyone,
> >>  I want know that "is there any possiblity that
> >> service scheduled will be
> >> stopped"
> >>  why i am asking this question is I had scheduled
> a
> >> service to run forever
> >> it ran successfully for 10 days after that when I
> >> restarted the server one
> >> of the service was not started .
> >> 
> >> regards
> >> Vamsi 
> >> -- 
> >> View this message in context:
> >>
> >
>
http://www.nabble.com/Regarding-Scheduled-services-tf2937798.html#a8213433
> >> Sent from the OFBiz - Dev mailing list archive at
> >> Nabble.com.
> >> 
> >> 
> > 
> > 
> > 
> 
> -- 
> View this message in context:
>
http://www.nabble.com/Regarding-Scheduled-services-tf2937798.html#a8213612
> Sent from the OFBiz - Dev mailing list archive at
> Nabble.com.
> 
> 


Re: Regarding Scheduled services

Posted by Vamsi <va...@gmail.com>.
hi
Thanks for responding
I am Using Mysql database
regards
Vamsi

cjhowe wrote:
> 
> Services that are scheduled are registered in the
> JobSandbox entity.  After they run, they reschedule
> themselves as defined. So you may check there that
> your scheduled service had the right field values.
> 
> If you are using MySql, it is possible that the
> service runs because the start time might be
> registered in cache but then when the service goes to
> reschedule itself it cannot create the reschedule
> entry because the MySql connection will close after 8
> hours of inactivity. 
> 
> What database are you running?
> 
> 
> --- Vamsi <va...@gmail.com> wrote:
> 
>> 
>> Hi everyone,
>>  I want know that "is there any possiblity that
>> service scheduled will be
>> stopped"
>>  why i am asking this question is I had scheduled a
>> service to run forever
>> it ran successfully for 10 days after that when I
>> restarted the server one
>> of the service was not started .
>> 
>> regards
>> Vamsi 
>> -- 
>> View this message in context:
>>
> http://www.nabble.com/Regarding-Scheduled-services-tf2937798.html#a8213433
>> Sent from the OFBiz - Dev mailing list archive at
>> Nabble.com.
>> 
>> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Regarding-Scheduled-services-tf2937798.html#a8213612
Sent from the OFBiz - Dev mailing list archive at Nabble.com.


Re: Regarding Scheduled services

Posted by Chris Howe <cj...@yahoo.com>.
--- Chris Howe <cj...@yahoo.com> wrote:

> 
> --- David E Jones <jo...@undersunconsulting.com>
> wrote:
> 
> > 
> > Hmmm.... I've never heard of anything like this
> > happening before.
> > 

One more thing...this "security enhancement" of MySql
was introduced with MySql 5.0 as previous versions,
the ?autoReconnect=true addition to the jdbc-uri would
prevent this from occurring.   In MySql 5.0
autoReconnect has been deprecated. 

Re: Regarding Scheduled services

Posted by Chris Howe <cj...@yahoo.com>.
--- David E Jones <jo...@undersunconsulting.com>
wrote:

> 
> Hmmm.... I've never heard of anything like this
> happening before.
> 
> There may be some errors that can get a scheduled
> service record in a  
> bad state, but it's pretty rare.
> 
> The thing to do is send over some more details, like
> the service  
> definition, and the most recent records in the
> JobSandbox table for  
> the job in question.
> 
> -David
> 
>

I haven't personally witnessed this happen with the
JobSandbox, but I have witnessed it with the UserLogin
routines.  User can't login because MySql has cut off
the connection to the database and so the
UserLoginHistory can't be entered and therefore the
user login fails.  The service that calls the
simple-method I included in the previous message has
prevented the user login failure from occurring in our deployment.

Re: Regarding Scheduled services

Posted by David E Jones <jo...@undersunconsulting.com>.
On Jan 8, 2007, at 12:06 AM, Chris Howe wrote:

> Services that are scheduled are registered in the
> JobSandbox entity.  After they run, they reschedule
> themselves as defined. So you may check there that
> your scheduled service had the right field values.
>
> If you are using MySql, it is possible that the
> service runs because the start time might be
> registered in cache but then when the service goes to
> reschedule itself it cannot create the reschedule
> entry because the MySql connection will close after 8
> hours of inactivity.

Hmmm.... I've never heard of anything like this happening before.

There may be some errors that can get a scheduled service record in a  
bad state, but it's pretty rare.

The thing to do is send over some more details, like the service  
definition, and the most recent records in the JobSandbox table for  
the job in question.

-David


> --- Vamsi <va...@gmail.com> wrote:
>
>>
>> Hi everyone,
>>  I want know that "is there any possiblity that
>> service scheduled will be
>> stopped"
>>  why i am asking this question is I had scheduled a
>> service to run forever
>> it ran successfully for 10 days after that when I
>> restarted the server one
>> of the service was not started .
>>
>> regards
>> Vamsi
>> -- 
>> View this message in context:
>>
> http://www.nabble.com/Regarding-Scheduled-services- 
> tf2937798.html#a8213433
>> Sent from the OFBiz - Dev mailing list archive at
>> Nabble.com.
>>
>>
>


Re: Regarding Scheduled services

Posted by Chris Howe <cj...@yahoo.com>.
Services that are scheduled are registered in the
JobSandbox entity.  After they run, they reschedule
themselves as defined. So you may check there that
your scheduled service had the right field values.

If you are using MySql, it is possible that the
service runs because the start time might be
registered in cache but then when the service goes to
reschedule itself it cannot create the reschedule
entry because the MySql connection will close after 8
hours of inactivity. 

What database are you running?


--- Vamsi <va...@gmail.com> wrote:

> 
> Hi everyone,
>  I want know that "is there any possiblity that
> service scheduled will be
> stopped"
>  why i am asking this question is I had scheduled a
> service to run forever
> it ran successfully for 10 days after that when I
> restarted the server one
> of the service was not started .
> 
> regards
> Vamsi 
> -- 
> View this message in context:
>
http://www.nabble.com/Regarding-Scheduled-services-tf2937798.html#a8213433
> Sent from the OFBiz - Dev mailing list archive at
> Nabble.com.
> 
>