Title: Message
Hi Saroj,
 
I am again here with the same problem. I replied late because of some other office tasks. I have tried the changes that u have mentioned but no luck, I got the same reply from jboss :(. There is another message in this thread from Ooi Leng Chai <[EMAIL PROTECTED]>. probably u have gone through his mail. So what should I try next. I gona try jboss 3.1. But I want 2.4.6 as our application is working smoothly over 2.4.6 except this remove problem.
waiting for your reply.
 
Thanks again,
 
Nayyer Kamran
 
----- Original Message -----
Sent: Monday, August 19, 2002 11:04 AM
Subject: RE: [JBoss-user] illegalArgumentException while removing the entity bean

Hi Kamran,
 
I would like to point out something regarding use of remove() method on EJBHome/EJBObject.
 
EJBObject : No need to use Handle here.  I think that you are not using this method. It seems that you are calling EJBHome.remove();
 
EJBHomeObject: There are 2 ways to remove.
 
    1) Use PK . home.remove(pk) - I generally use this or EJBObject.remove()
 
    2) home.remove(handle)
 
Observation: Mostly It looks fine to me except one small suggestion.
 
Suggestion: Instead of using this for EQUALS check , try the following :
   
 
    EXISTING CODE
    **********************
    public boolean equals(Object obj) {
        if (this.getClass().equals(obj.getClass())) {
            ApplicationPK that = (ApplicationPK) obj;
            return this.appID.intValue() == that.appID.intValue();
        }
        return false;
    }
 
    SUGGESTED CODE
    ***********************
    public boolean equals(Object obj)
     {
      boolean retVal = false;
 
      if ( obj instanceof ApplicationPK )
       {
       ApplicationPK pk = (AddressPK) obj;
 
   retVal =
    this.appID.intValue() == pk.appID.intValue();
      }
      return retVal;
     }
 
    EXISTING CODE
    **********************
    public ApplicationPK() {
        appID = new Integer(0);
    }
   
    SUGGESTED CODE
    **************************
    public ApplicationPK()
    {
    }
 
I think this should solve the problem.
 
-Saroj
 
PS. was out on the weekend. That caused the late reply.

Reply via email to