does anybody know how to make EJBTimers persistent not in filesystem, but in selected database table?
Like, for instance, in JBoss 4.x.x with the help of ejb-deployer.xml:
<?xml version="1.0" encoding="UTF-8"?>
<server>
...
<mbean code="org.jboss.ejb.txtimer.EJBTimerServiceImpl"
name="jboss.ejb:service=EJBTimerService">
<attribute name="RetryPolicy">jboss.ejb:service=EJBTimerService,retryPolicy=fixedDelay</attribute>
<attribute name="PersistencePolicy">jboss.ejb:service=EJBTimerService,persistencePolicy=database</attribute>
<attribute name="TimerIdGeneratorClassName">org.jboss.ejb.txtimer.BigIntegerTimerIdGenerator</attribute>
<attribute name="TimedObjectInvokerClassName">org.jboss.ejb.txtimer.TimedObjectInvokerImpl</attribute>
<depends optional-attribute-name="TransactionManagerFactory" proxy-type="org.jboss.tm.TransactionManagerFactory">
jboss:service=TransactionManager
</depends>
</mbean>
<!-- A retry policy that uses a fixed interval in milli seconds -->
<mbean code="org.jboss.ejb.txtimer.FixedDelayRetryPolicy" name="jboss.ejb:service=EJBTimerService,retryPolicy=fixedDelay">
<attribute name="Delay">100</attribute>
</mbean>
<mbean code="org.jboss.ejb.txtimer.DatabasePersistencePolicy" name="jboss.ejb:service=EJBTimerService,persistencePolicy=database">
<!-- DataSourceBinding ObjectName -->
<depends optional-attribute-name="DataSource">jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
<!-- The plugin that handles database persistence -->
<attribute name="DatabasePersistencePlugin">org.jboss.ejb.txtimer.GeneralPurposeDatabasePersistencePlugin</attribute>
<!-- The timers table name -->
<attribute name="TimersTable">TIMERS</attribute>
</mbean>
</server>
I’ve found nothing how to replace this one:
<timer-service thread-pool-name="default">
<data-store path="timer-service-data" relative-to="jboss.server.data.dir"/>
</timer-service>
to force timers to be persisted in DB.
Thanks in advance!
At the moment, persistent EJBTimers are stored to the filesystem only. A corresponding issue already exists. Unfortunately, it is targeted for the EAP system only… Take a look at the Cron Module of Seam 3. This module works with Quartz which provides JDBC stored timers.