2 Replies Latest reply on Nov 9, 2011 1:46 PM by vitorrm

    JBoss 6.0.0.Final serialize timers

    p_kaiser

      Hi,

      I am running a two-node cluster using JBoss 6.0.0.Final. I have problems serializing my timers to a MSSQL- or ORALE-database.

       

      I migrated from JBoss 4.2.2GA. There the timers worked for single and clustermode. The timers are still running with JBoss 6 if I use the same JBoss in single-mode with the default configuration and hsql-database.

       

      The problem seems to be that the column "INFO" in the JBoss-table "TIMER" is to small. It is mapped as a "RAW" Type with just 255 characters. I need "BLOB" which has 4000.

       

      My Java-Code is as following:

       

      public static void enableTimer(SessionPrincipal sessionPrincipal, TimerService timerService, long period)
      {
              if (timerService.getTimers().size() == 0)
              {
                  //This call crashes
                  Timer timer =
                      timerService.createTimer(period, period, new Object[] { sessionPrincipal, new Long(period) });
              }//...
      }
      

       

      The Oracle-message is:

       

      ORA-12899: Wert zu groß für Spalte "MYAPP"."TIMER"."INFO" (aktuell: 1077, maximal: 255)

      SQL Error: 12899, SQLState: 72000

       

      I tried the following:

      1. Set the dialect in the server\all\deploy\MY-ds.xml

      2. I also set the dialect in server\all\deployers\ejb3.deployer\META-INF\jpa-deployers-jboss-beans.xml

      3. I added a mapping for java.io.Serializable in server\all\conf\standardjbosscmp-jdbc.xml

       

      <mapping>
              <java-type>java.io.Serializable</java-type>
              <jdbc-type>BLOB</jdbc-type>
              <sql-type>BLOB</sql-type>
      </mapping>

      4. I tried with and without all the properties in my common\deploy\jboss-ejb3-timerservice-mk2.jar\META-INF\jboss-ejb3-timerservice-mk2-jboss-beans.xml

       

      <persistence xmlns="http://java.sun.com/xml/ns/persistence"   
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
         http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
         version="1.0">
         <persistence-unit name="timerdb">
            <jta-data-source>java:/DefaultDS</jta-data-source>
            <class>org.jboss.ejb3.timerservice.mk2.persistence.TimerEntity</class>
            <properties>
                <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
                <property name="hibernate.transaction.factory_class" value="org.hibernate.ejb.transaction.JoinableCMTTransactionFactory"/>
                <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
                <property name="hibernate.hbm2ddl.auto" value="update"/>
            </properties>
         </persistence-unit>
      </persistence>
      

       

      I am running out of ideas. Any suggestions?

       

      Thanks in advance.