3 Replies Latest reply on May 21, 2003 5:24 PM by bobbob

    getEJBLocalObject() bug?

    nabuccodonosor

      I'm using a business method in an entity bean that should return the primary key of the record the local object refers to.

      The method is this

      public int getId_fun()
      {
      final FunctionalityLocal func = (FunctionalityLocal)entityContext.getEJBLocalObject();
      return ((Integer)func.getPrimaryKey()).intValue();
      }

      the business method simulate the equivalent abstract method that in this case can't be used because the auto incremental key.

      This method work perfectly until the entity bean is passivated and then reactivated.

      I think there is an error on the implementation of the getEJBLocalObject() method, infact after the bean has been passivated it don't return the right reference of the EJBLocalObject and i find a wrong id_fun with other right fields.

      So i have to call directly on the local interface the getPrimaryKey() method and then every time make the cast to int.

      Is this problem a bug or a correct behaviour?