If you have a JEE EJB Timer in a Cluster, maybe you want only 1 instance to be active. In this case you should implement a Cluster Aware Singleton Component :
https://blogs.oracle.com/muraliveligeti/entry/ejb_timer_ejb
- create table WEBLOGIC_TIMERS
configure a Datasource and set it in "cluster-Scheduling":
Showing posts with label scheduler. Show all posts
Showing posts with label scheduler. Show all posts
Sunday, May 8, 2016
Monday, July 23, 2012
DBMS_SCHEDULER quick tutorial
http://www.oracle-base.com/articles/10g/scheduler-10g.php
http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_sched.htm#ARPLS138
Putting into action: let's create a job running every minute to delete all records from the table PIPPO:
CREATE TABLE "PIPPO" ("NAME" VARCHAR2(20 BYTE)) ;
insert into PIPPO values ('A');
insert into PIPPO values ('B');
commit();
then we create a stored procedure to delete records:
create or replace
PROCEDURE MY_JOB_PROCEDURE AS
BEGIN
delete from PIPPO;
END MY_JOB_PROCEDURE;
then I create the job:
BEGIN
DBMS_SCHEDULER.create_job (
job_name => 'test_full_job_definition',
job_type => 'PLSQL_BLOCK',
job_action => 'BEGIN my_job_procedure; END;',
start_date => SYSTIMESTAMP,
repeat_interval => 'freq=MINUTELY; byminute=0; bysecond=0;',
end_date => NULL,
enabled => TRUE,
comments => 'Job defined entirely by the CREATE JOB procedure.');
END;
/
http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_sched.htm#ARPLS138
Putting into action: let's create a job running every minute to delete all records from the table PIPPO:
CREATE TABLE "PIPPO" ("NAME" VARCHAR2(20 BYTE)) ;
insert into PIPPO values ('A');
insert into PIPPO values ('B');
commit();
then we create a stored procedure to delete records:
create or replace
PROCEDURE MY_JOB_PROCEDURE AS
BEGIN
delete from PIPPO;
END MY_JOB_PROCEDURE;
then I create the job:
BEGIN
DBMS_SCHEDULER.create_job (
job_name => 'test_full_job_definition',
job_type => 'PLSQL_BLOCK',
job_action => 'BEGIN my_job_procedure; END;',
start_date => SYSTIMESTAMP,
repeat_interval => 'freq=MINUTELY; byminute=0; bysecond=0;',
end_date => NULL,
enabled => TRUE,
comments => 'Job defined entirely by the CREATE JOB procedure.');
END;
/
Labels:
scheduler
Saturday, January 29, 2011
Cheap SOA Scheduler with SOA Suite
We have discussed in another post some possibilities to create a scheduler in SOA Suite. They are all very complicated.
A cheap and dirty way to trigger a BPEL process at regular intervals is creating a TRIGGERME table with a field STATUS, and using a DBAdapter in the Exposed Services lane with a "Poll for new or updated rows" option, and using the same value for UNREAD and READ value in the STATUS field.
You can set the frequency of the polling to anything you want.
This pattern is valid only for regular scheduling with no control on the starting time, so it's really a raw scheduler.
A cheap and dirty way to trigger a BPEL process at regular intervals is creating a TRIGGERME table with a field STATUS, and using a DBAdapter in the Exposed Services lane with a "Poll for new or updated rows" option, and using the same value for UNREAD and READ value in the STATUS field.
You can set the frequency of the polling to anything you want.
This pattern is valid only for regular scheduling with no control on the starting time, so it's really a raw scheduler.
Labels:
scheduler
Thursday, December 16, 2010
CommonJ timer with OSB, SOA Suite, SOA Scheduler
an excellent document on SOA Scheduler here:
http://www.oracle.com/technetwork/middleware/soasuite/learnmore/soascheduler-186798.pdf
I have tested it and it works beautifully! You can specify the cron parameters in a single place. Of course it can be improved but it's a good starting point.
Here the code (I hope Robert Baumgartner doesn't mind).
I feel it would be better to have the Scheduler post an EDN event using
oracle.integration.platform.blocks.event.SendEvent and wake up a Mediator instance,
rather than synchronously invoke the WS to trigger the BPEL process.
This SendEvent class is in C:\Oracle1\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime.jar
Unfortunately it looks like the only way to use it is by invoking its main(...) procedure after having set the System properties with: dbconn,dbuser, dbpass, eventName, eventBody,event parameters. Internally it uses a SAQRemoteBusinessEventConnectionFactory and a BusinessEventBuilder. All this make it a bit complicated to generate events programmatically.
here is CommonJ doc:
http://download.oracle.com/docs/cd/E12840_01/wls/docs103/commonj/commonj.html with coverage of "cluster-wide" timers.
Here the excellent tutorial by James Bayer:
http://blogs.oracle.com/jamesbayer/2007/11/weblogic_scheduling_a_polling.html
and more here:
http://blogs.oracle.com/jamesbayer/2009/04/a_simple_job_scheduler_example.html
and a very nice tutorial on CommonJ TimerManager here
http://middlewaremagic.com/weblogic/?p=987
here the code
Other alternatives:
EJB 3.0 Timer:
http://www.javabeat.net/articles/3-ejb-30-timer-services-an-overview-1.html
more specifically in a cluster:
http://shaoxiongyang.blogspot.com/2010/10/how-to-use-ejb-3-timer-in-weblogic-10.html
I really feel a pain comparing the SOA Suite support for scheduling with the one offered by Apache Camel:
http://camel.apache.org/quartz.html
(17-Jan-2011) I discover there is a PICK activity in BPEL allowing you to schedule a BPEL process at given interval. This is most likely the simplest solution:
http://download.oracle.com/docs/cd/B31017_01/integrate.1013/b28981/events.htm#CHDECBGD
http://www.oracle.com/technetwork/middleware/soasuite/learnmore/soascheduler-186798.pdf
I have tested it and it works beautifully! You can specify the cron parameters in a single place. Of course it can be improved but it's a good starting point.
Here the code (I hope Robert Baumgartner doesn't mind).
I feel it would be better to have the Scheduler post an EDN event using
oracle.integration.platform.blocks.event.SendEvent and wake up a Mediator instance,
rather than synchronously invoke the WS to trigger the BPEL process.
This SendEvent class is in C:\Oracle1\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime.jar
Unfortunately it looks like the only way to use it is by invoking its main(...) procedure after having set the System properties with: dbconn,dbuser, dbpass, eventName, eventBody,event parameters. Internally it uses a SAQRemoteBusinessEventConnectionFactory and a BusinessEventBuilder. All this make it a bit complicated to generate events programmatically.
here is CommonJ doc:
http://download.oracle.com/docs/cd/E12840_01/wls/docs103/commonj/commonj.html with coverage of "cluster-wide" timers.
Here the excellent tutorial by James Bayer:
http://blogs.oracle.com/jamesbayer/2007/11/weblogic_scheduling_a_polling.html
and more here:
http://blogs.oracle.com/jamesbayer/2009/04/a_simple_job_scheduler_example.html
and a very nice tutorial on CommonJ TimerManager here
http://middlewaremagic.com/weblogic/?p=987
here the code
Other alternatives:
EJB 3.0 Timer:
http://www.javabeat.net/articles/3-ejb-30-timer-services-an-overview-1.html
more specifically in a cluster:
http://shaoxiongyang.blogspot.com/2010/10/how-to-use-ejb-3-timer-in-weblogic-10.html
I really feel a pain comparing the SOA Suite support for scheduling with the one offered by Apache Camel:
http://camel.apache.org/quartz.html
(17-Jan-2011) I discover there is a PICK activity in BPEL allowing you to schedule a BPEL process at given interval. This is most likely the simplest solution:
http://download.oracle.com/docs/cd/B31017_01/integrate.1013/b28981/events.htm#CHDECBGD
Subscribe to:
Posts (Atom)