You can configure the Enterprise JavaBeans (EJB) timer service for timers
that can persist through application server shutdowns and restarts.
Before you begin
A database instance must exist before you
complete either of the processes that are documented in this topic.
For example, you might have a DB2® or
Oracle instance. You must configure the Timer Service to use that
database.
About this task
You can configure the timer service to share
the same database across multiple servers. However, each server must
use its own unique database table. Complete one of the following processes
to configure the timer service to share the same database across multiple
servers:
Procedure
- Configure a scheduler instance for the cluster, then
configure the timer service to use that scheduler instance.
- Configure a scheduler instance for the cluster.
This creates for you a custom scheduler instance. Next
you need to configure the timer service to use that custom instance.
- Open the administrative console.
- Click Servers >Application Servers > servername > EJB
Container Settings > EJB timer service settings.
The timer service settings panel appears.
- Select the Use custom scheduler instance radio
button.
- Select your Scheduler JNDI name from the dropdown
list.
- Click Apply.
- Click OK.
- Configure the timer service default scheduler instance
for each server to use the same data source.
- Select the Use internal EJB timer service scheduler
instance radio button. To customize the pre-configured
instance:
- To change the data source (you can use any supported
database, such as DB2 or Oracle)
select your Data source JNDI name from the dropdown list.
The default database listed cannot be shared, because it is
configured to be visible to one server only, and it uses the single
server version of Apache Derby, which can only be accessed by one
server process at a time.
- Enter your chosen Datasource Alias.
- Enter your chosen Table Prefix if you want to
have several server processes use the same database, but different
tables.
- Enter a Poll Interval value in milliseconds.
For more information about the fields, read about EJB timer
service settings
- Click Apply.
- Click OK.
- Change all of your server processes to use the same
database you chose from the Data source JNDI name dropdown
list earlier.