0 Replies Latest reply on Nov 10, 2005 8:23 AM by chaitanya

    getting problem ejbRemove method in jboss

    chaitanya Novice

      this is the sample method in session bean in when u delete a bean

      ExampleEntityHome home = (ExampleEntityHome)ejbHomeFactory.lookupHome("ExampleEntityBean",ExampleEntityHome.class);
      ExampleEntity remote = home.findByPrimaryKey(1221);
      remote.remove();

      Container inturns calls ejbRemove() method.ejbRemove prints in server.log after that it goes to remove method of exampleDAO class then i am making header= null(to optimize memory i am making object is null);

      but i am getting nullpointerexception in remove method of exampleDAO class where i am using header object

      my question after completing remove method only i am making header=null; why container is calling before header = null;

      it works well in oc4j server;getting problem in jboss


      entity bean
      public void ejbRemove()
      throws javax.ejb.RemoveException
      {
      try
      {
      System.out.println("ejbRemove");
      long seqno = ((Long)entityContext.getPrimaryKey()).longValue();
      ExampleDAO exampleDAO = new ExampleDAO();
      exampleDAO.remove(seqno,header);
      this.header = null;
      }

      }