You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Vyom Jain <vy...@gmail.com> on 2014/08/03 18:14:24 UTC

Processing entries in custom table

Hello Everyone,

I've a requirement to process a custom table which is populated by an
external application. It is required that entries are processed as fast as
possible.
To achieve this a service has been written which is scheduled to execute
every 5 seconds (done via changing configuration in serviceengine.xml &
temporal expressions).

While this approach works well, I've noticed that at times multiple
instances of service getting scheduled, this probably happens because the
service that was initially scheduled took longer than 5 seconds to
complete. Is there a way I can ensure only 1 instance of the service is
active at any given point in time?

Can anyone suggest a better approach in which job scheduler isn't involved?

I'm using a heavily customized version of OFBiz which is somewhere between
v09.04 & 10.04 and doesn't have the advantages of job scheduler fixes added
in later versions.

--
Vyom

Re: Processing entries in custom table

Posted by Vyom Jain <vy...@gmail.com>.
I'm using the semaphore="wait" approach which is working well for my
implementation.

--
Vyom


On 4 August 2014 00:13, Youssef Khaye <y....@unionsmarket.com> wrote:

> you may use service semaphore (with fail type) to achieve this.
> When the service is invoked it will create a kind of lock (an entry
> with the service name as a value in the semaphore table), if the lock
> already exists (because of old one still running), the new service will
> fails.
>
> hope this help.
>
> Le 03/08/2014 18:14, Vyom Jain a écrit :
>
>  Hello Everyone,
>>
>> I've a requirement to process a custom table which is populated by an
>> external application. It is required that entries are processed as fast as
>> possible.
>> To achieve this a service has been written which is scheduled to execute
>> every 5 seconds (done via changing configuration in serviceengine.xml &
>> temporal expressions).
>>
>> While this approach works well, I've noticed that at times multiple
>> instances of service getting scheduled, this probably happens because the
>> service that was initially scheduled took longer than 5 seconds to
>> complete. Is there a way I can ensure only 1 instance of the service is
>> active at any given point in time?
>>
>> Can anyone suggest a better approach in which job scheduler isn't
>> involved?
>>
>> I'm using a heavily customized version of OFBiz which is somewhere between
>> v09.04 & 10.04 and doesn't have the advantages of job scheduler fixes
>> added
>> in later versions.
>>
>> --
>> Vyom
>>
>>
>

Re: Processing entries in custom table

Posted by Youssef Khaye <y....@unionsmarket.com>.
you may use service semaphore (with fail type) to achieve this.
When the service is invoked it will create a kind of lock (an entry
with the service name as a value in the semaphore table), if the lock 
already exists (because of old one still running), the new service will 
fails.

hope this help.

Le 03/08/2014 18:14, Vyom Jain a écrit :
> Hello Everyone,
>
> I've a requirement to process a custom table which is populated by an
> external application. It is required that entries are processed as fast as
> possible.
> To achieve this a service has been written which is scheduled to execute
> every 5 seconds (done via changing configuration in serviceengine.xml &
> temporal expressions).
>
> While this approach works well, I've noticed that at times multiple
> instances of service getting scheduled, this probably happens because the
> service that was initially scheduled took longer than 5 seconds to
> complete. Is there a way I can ensure only 1 instance of the service is
> active at any given point in time?
>
> Can anyone suggest a better approach in which job scheduler isn't involved?
>
> I'm using a heavily customized version of OFBiz which is somewhere between
> v09.04 & 10.04 and doesn't have the advantages of job scheduler fixes added
> in later versions.
>
> --
> Vyom
>


Re: Processing entries in custom table

Posted by Adrian Crum <ad...@sandglass-software.com>.
Try to backport the fixes. The old Job Scheduler was very unreliable 
(duplicate jobs, missing jobs, etc).

Adrian Crum
Sandglass Software
www.sandglass-software.com

On 8/3/2014 5:14 PM, Vyom Jain wrote:
> Hello Everyone,
>
> I've a requirement to process a custom table which is populated by an
> external application. It is required that entries are processed as fast as
> possible.
> To achieve this a service has been written which is scheduled to execute
> every 5 seconds (done via changing configuration in serviceengine.xml &
> temporal expressions).
>
> While this approach works well, I've noticed that at times multiple
> instances of service getting scheduled, this probably happens because the
> service that was initially scheduled took longer than 5 seconds to
> complete. Is there a way I can ensure only 1 instance of the service is
> active at any given point in time?
>
> Can anyone suggest a better approach in which job scheduler isn't involved?
>
> I'm using a heavily customized version of OFBiz which is somewhere between
> v09.04 & 10.04 and doesn't have the advantages of job scheduler fixes added
> in later versions.
>
> --
> Vyom
>