0 Replies Latest reply on Jun 28, 2007 12:41 PM by rmemoria

    Strange behaviour in 2.0.0beta1

    rmemoria

      I've been upgrading since version 1.2.1 and in version 2.0.0.beta1 I found something very strange:

      I have a long running conversation with an EntityHome bean like that:

      @Name("recebimentoHome")
      public class RecebimentoHome extends EntityHome<Recebimento> {
      
      private ItemRecebimento itemRec;
      
      @Factory("recebimento")
      public Recebimento getRecebimento() {
       return getInstance();
      }
      
      public ItemRecebimento getItem() {
       if (itemRec == null) {
       itemRec = new ItemRecebimento();
       }
      
       return itemRecebimento;
      }
      
      public void addNewItem() {
       getInstance().getItens().add(itemRec);
       itemRec = null;
      }
      ..
      ..
      ..


      So when the addNewItem() is called from a button, the property recebimentoHome.item should return a new item, but in fact, after calling addNewItem() the property itemRec is restored to the previous value . The same before calling addNewItem().

      Any tip?

      Regards,
      Ricardo Memória