21.6. Configuring the EJB3 Timer Service
21.6.1. EJB3 Timer Service
21.6.2. Configure the EJB3 Timer Service
Procedure 21.21. Configure the EJB3 Timer Service Thread Pool via the Management Console
- The thread pool to be used by the EJB3 Timer Service must already have been created.
- Login to the Management Console.
- Click on the tab at the top of the screen. Expand the menu and select . Select the tab, click on . Click .
- Click on the EJB3 Thread Pool drop-down list and click on the preferred thread pool's name.
- Restart the JBoss EAP instance.
Procedure 21.22. Configure the EJB3 Timer Service Thread Pool via the Management CLI
Note
/profile=PROFILE_NAME to the command for a managed domain.
- Run the following Management CLI command.
/subsystem=ejb3/service=timer-service:write-attribute(name=thread-pool-name,value="thread-pool-name")
- Restart the JBoss EAP instance.
Procedure 21.23. Configure the EJB3 Timer Service Directory via the Management Console
- Login to the Management Console.
- Click on the tab at the top of the screen. Expand the menu and select . Select the tab, click on . Click .
- Enter your desired values into the
PathandRelative Tofields. - Click .
- Restart the JBoss EAP instance.
Procedure 21.24. Configure the EJB3 Timer Service Directory via the Management CLI
- Depending on which paths you want to change, run one or both of the following Management CLI commands. For either path you can use a system value - for example,
${jboss.server.data.dir}.Note
Add the prefix/profile=PROFILE_NAMEto the command for a managed domain./subsystem=ejb3/service=timer-service/file-data-store=default-file-store:write-attribute(name=path,value="path")
/subsystem=ejb3/service=timer-service/file-data-store=default-file-store:write-attribute(name=relative-to,value="relative-path")
- Restart the JBoss EAP instance.
Procedure 21.25. Configure the EJB3 Timer Service to use a Datasource via the Management CLI
- The datasource to be used by the EJB3 Timer Service must already exist and the underlying database must support and be configured for READ_COMMITTED or SERIALIZABLE isolation mode.
Note
/profile=PROFILE_NAME to the command for a managed domain.
- Run the following Management CLI command.
- datastore_name - A name of your choice.
- datasource_name - The name of the datasource to be used for storage.
- database - either
postgresql,mssql,sybase,mysql,oracle,db2, orhsql. - partition_name - A name of your choice. This attribute is used to distinguish timers pertaining to a particular server instance if multiple JBoss EAP instances share the same database for storing EJB timers. In this case, every server instance should have its own partition name. If the database is used by only one server instance, you can leave this attribute blank.
/subsystem=ejb3/service=timer-service/database-data-store=datastore_name:add(datasource-jndi-name='java:/datasource_name', database='database', partition='partition_name')
Procedure 21.26. Configure one or all EJB3 Deployments to use the Datasource
- To configure an EJB3 deployment to use the datasource, edit the
jboss-ejb3.xmlof the deployment so thetimersection looks as follows. Replacedatastore_namewith the name of the datastore.[<assembly-descriptor> <timer:timer> <ejb-name>*</ejb-name> <timer:persistence-store-name>datastore_name</timer:persistence-store-name> </timer:timer> </assembly-descriptor> - To configure the datasource as the default for all deployments, run the following Management CLI command, then restart the JBoss EAP instance. Replace
datastore_namewith the name of the datastore.Note
Add the prefix/profile=PROFILE_NAMEto the command for a managed domain.[/subsystem=ejb3/service=timer-service:write-attribute(name=default-data-store,value=datastore_name)

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.