Set a timer service
To configure a timer service, follow these steps.
- Open the admin console.
- Click Servers > Application servers > server_name > EJB Container settings > EJB timer service settings.
The timer service settings panel is displayed.
- To use the internal, or pre-configured, scheduler instance, click the Use internal EJB timer service scheduler instance radio button.
If we choose not to change the default settings, this instance is associated with a Apache Derby database. If we choose to customize the pre-configured instance:
- To change the data source (we can use any supported database, such as DB2 or Oracle), enter the Data source JNDI name.
- Enter the chosen Data source alias.
- Enter the chosen Table prefix to have several server processes use the same database, but different tables.
- Enter a Poll interval value in milliseconds.
- If we want more timers to execute concurrently, enter a new value for Number of timer threads.
See about the fields, see EJB timer service settings
- To configure our own scheduler instance instead of using the pre-configured internal one, click the Use custom scheduler instance radio button. Some reasons we might want to use our own instance are:
- to change scheduler service configuration options not available for customization on this panel
- to keep EJB Timer tasks in the same database tables as the other tasks
- we are running in a Clustered environment and want to have a single scheduler instance handle all of the EJB Timers for the cluster. This way, an ejbTimer Task created on one cluster member can execute on a different cluster member.
To use our own instance, :
- Set a scheduler instance through the Scheduler Service GUI. See Use schedulers for information on how to do this.
- Select the Scheduler JNDI name from the list.
- Click Apply.
- Click OK.
Set a timer service for network deployment
Example: Using the Timer Service
EJB timer service settings