[jboss-jira] [JBoss JIRA] (WFLY-9054) Use of schedule expression start/end date for (Database) persistent calendar timers fail if the server is restarted and the timer reloaded

Wolf-Dieter Fink (JIRA) issues at jboss.org
Thu Jul 6 08:15:00 EDT 2017


    [ https://issues.jboss.org/browse/WFLY-9054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13431523#comment-13431523 ] 

Wolf-Dieter Fink commented on WFLY-9054:
----------------------------------------

First Analysis
The fields SCHEDULE_EXPR_START_DATE SCHEDULE_EXPR_END_DATE are VARCHAR2 (or VARCHAR for others)
The internal value is java.util.Date which is converted to java.sql.Timestamp
Other database write the String as "YYYY-MM-DD hh:mm:ss.fffffffff' but Oracle do it in a different format like '06-JUL-17 01.54.00.269000000 PM', but expect to read the correct one.

Changing the value into the correct format after creation work correct.
Also changing the field type to TIMESTAMP work correct.

It seems an Oracle specific issue

> Use of schedule expression start/end date for (Database) persistent calendar timers fail if the server is restarted and the timer reloaded
> ------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WFLY-9054
>                 URL: https://issues.jboss.org/browse/WFLY-9054
>             Project: WildFly
>          Issue Type: Bug
>          Components: EJB
>    Affects Versions: 11.0.0.Alpha1
>         Environment: Oracle Database as datasource for timers
>             <timer-service thread-pool-name="default" default-data-store="default-store">
>                 <data-stores>
>                     <database-data-store name="default-store" datasource-jndi-name="jboss/datasources/OracleDatasource"/>
>                 </data-stores>
>             </timer-service>
>            Reporter: Wolf-Dieter Fink
>              Labels: ejb, timers, timerservice
>
> If Calendar timers are created programatically it is possible to use the javax.ejb.ScheduleExpression and set start() end() as a Date.
> If the timer is persistent and the database is Oracle (here 12c ojdbc7 driver) a server restart will show the following Exception is:
> 13:55:00,450 WARN  [org.jboss.as.ejb3.timer] (ServerService Thread Pool -- 63) WFLYEJB0161: Failed to reinstate timer 'ejb31-timer.ejb31-timer.SimpleScheduleSingletonTimerBean' (id=bd2e59a0-bdf6-43a1-9241-fd3a0b3a72da) from its persistent state: java.sql.SQLException: Invalid conversion requested
> 	at oracle.jdbc.driver.CharCommonAccessor.getTimestamp(CharCommonAccessor.java:420)
> 	at oracle.jdbc.driver.T4CVarcharAccessor.getTimestamp(T4CVarcharAccessor.java:644)
> 	at oracle.jdbc.driver.GeneratedStatement.getTimestamp(GeneratedStatement.java:360)
> 	at oracle.jdbc.driver.GeneratedScrollableResultSet.getTimestamp(GeneratedScrollableResultSet.java:1008)
> 	at org.jboss.jca.adapters.jdbc.WrappedResultSet.getTimestamp(WrappedResultSet.java:2140)
> 	at org.jboss.as.ejb3.timerservice.persistence.database.DatabaseTimerPersistence.timerFromResult(DatabaseTimerPersistence.java:535)
> 	at org.jboss.as.ejb3.timerservice.persistence.database.DatabaseTimerPersistence.loadActiveTimers(DatabaseTimerPersistence.java:452)
> 	at org.jboss.as.ejb3.timerservice.TimerServiceImpl.getActivePersistentTimers(TimerServiceImpl.java:953)
> 	at org.jboss.as.ejb3.timerservice.TimerServiceImpl.restoreTimers(TimerServiceImpl.java:693)
> 	at org.jboss.as.ejb3.timerservice.TimerServiceImpl.activate(TimerServiceImpl.java:225)
> 	at org.jboss.as.ejb3.component.EJBComponent.start(EJBComponent.java:588)
> 	at org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:133)
> 	at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:54)
> 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> 	at java.lang.Thread.run(Thread.java:748)
> 	at org.jboss.threads.JBossThread.run(JBossThread.java:320)
> Caused by: java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]
> 	at java.sql.Timestamp.valueOf(Timestamp.java:237)
> 	at oracle.jdbc.driver.CharCommonAccessor.getTimestamp(CharCommonAccessor.java:415)
> 	... 18 more
> As a result the timer seems created with a new id and the entry within the timer-table is duplicated.



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the jboss-jira mailing list