0 Replies Latest reply: Dec 18, 2012 11:33 AM by user13109986 RSS

    ejb 3 timer ignoring intervalDuration a always triggered every 30 seconds

    user13109986
      HI All,

      I have created EJB 3 Timer and it is deployed into weblogic cluster. The createTimer parameters are createTimer(1000, 20000, null);
      This should create recurring timer for every 20 seconds. But the timer is always created every 30 seconds. I even changed the intervalDuration to 40 and 50 seconds but the timeout method is always triggered every 30 seconds.

      Below are the entry from WEBLOGIC_TIMERS table
      1@@OSBNode2_1355845459844     (BLOB)     1355846770914     1000     TimerearTimerTest.jarTimerTest     OSBDomain     OSBCluster


      Below are the entry from ACTIVE table
      timer.1@@OSBNode2_1355843156331     -96726833478167425/OSBNode2     OSBDomain     OSBCluster     18-DEC-12
      service.TimerMaster     8866906753834651127/OSBNode1     OSBDomain     OSBCluster     18-DEC-12
      service.SINGLETON_MASTER     8866906753834651127/OSBNode1     OSBDomain     OSBCluster     18-DEC-12


      Can anyone help me to investigate why the timer always triggers every 30 second instead of my intervalDuration value?

      Below is the EJB ----->>

      package com.timertest;
      import java.util.*;
      import javax.annotation.Resource;
      import javax.ejb.*;

      @Stateless(mappedName = "TimerTest")
      public class TimerTest implements TimerTestRemote
      {
           @Resource
           private SessionContext ctx;

      @Override
      public void createMyTimer()
      throws EJBException
      {
           ctx.getTimerService().createTimer(1000, 20000, null);
      }

           @Timeout
      public void timeout(Timer timer)
           {
           System.out.println("-> Timed Out ..."+ new Date());

           }
      }

      Below is the and weblogic descripor-------->>
      <?xml version="1.0" encoding="UTF-8"?>
      <wls:weblogic-ejb-jar
           xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-ejb-jar"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd http://xmlns.oracle.com/weblogic/weblogic-ejb-jar http://xmlns.oracle.com/weblogic/weblogic-ejb-jar/1.2/weblogic-ejb-jar.xsd">
           <wls:weblogic-enterprise-bean>
                <wls:ejb-name>TimerTest</wls:ejb-name>
                <wls:stateless-session-descriptor>
                     
                     <wls:stateless-clustering>
                          <wls:home-is-clusterable>true</wls:home-is-clusterable>
                          <wls:home-load-algorithm>round-robin</wls:home-load-algorithm>
                          <wls:stateless-bean-is-clusterable>true</wls:stateless-bean-is-clusterable>
                          <wls:stateless-bean-load-algorithm>round-robin
                          </wls:stateless-bean-load-algorithm>
                     </wls:stateless-clustering>
                     <wls:business-interface-jndi-name-map>
                          <wls:business-remote>TimerTestRemote</wls:business-remote>
                          <wls:jndi-name>TimerTest</wls:jndi-name>
                     </wls:business-interface-jndi-name-map>
                </wls:stateless-session-descriptor>
                <wls:enable-call-by-reference>false</wls:enable-call-by-reference>
                <wls:jndi-name>TimerTest</wls:jndi-name>
           </wls:weblogic-enterprise-bean>
           <wls:timer-implementation>Clustered</wls:timer-implementation>
      </wls:weblogic-ejb-jar>


      Thanks in advance