0 Replies Latest reply on Sep 4, 2003 10:11 PM by timothyb

    block attributes not persisted

    timothyb

      Julien,

      I'm finishing up the polls module, two months later I know :-( Anyway, one thing I noticed was that when I restarted jboss it would forget the side attribute, it would go back to zero. When the poll block is deployed it will go where its supposed to, but then it forgets. Well after some debug, I narrowed it down to the JDBCPersistenceManager.load function:

      mbean.setAttribute(new Attribute(attName, attValue));
      timestamps.put(attName, new Long(System.currentTimeMillis() / 1000));

      When these to calls run one after another on my box, the timestamp written in the MBeanAttributeInterceptor will be the same.

      d.setField(LAST_UPDATED_TIME_STAMP, "" + System.currentTimeMillis() / 1000);

      By just removing the timestamps.put call in JDBCPersistenceManager.load everything will work because of the null check on previousUpdate in the store function:

      Long previousUpdate = (Long) timestamps.get(attName);
      if (!onUpdate || (previousUpdate == null || lastUpdate.compareTo(previousUpdate) > 0))
      {