1 Reply Latest reply on Jul 28, 2002 1:44 AM by dsundstrom

    Again BMP bugs.

    qiminghe

      Hi all:

      I have two posts on this topic
      "removing bean lock and it has tx set!"
      http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t=forums/ seems every body is fine except me. Some one mentioned
      to use PK-wrapper class instead of Integer class. I try it.
      The same problem. I generate almost all code by JBuilder 7.

      Any hints or any idea when this can be fixed?

      Qiming


      ----------------execute method in session bean--------------------
      public void execute() {
      try{
      InitialContext ctx=new InitialContext();
      myHome=(MytmpHome)ctx.lookup("java:comp/env/ejb/Mytmp");
      Mytmp s=myHome.findByPrimaryKey(new MytmpPK(new Integer(2)));
      s.setSesDuration(new Integer(321));
      //s.remove(); //does not work either.
      //myHome.revmove(new MytmpPK(new Integer(2))); //this works
      }catch(Exception e){
      e.printStackTrace();
      }
      ---------------------PK class----------------------------
      package bmptest2;

      import java.io.*;

      public class MytmpPK implements Serializable {


      public Integer subid;

      public MytmpPK() {
      }

      public MytmpPK(Integer subid) {
      this.subid = subid;
      }
      public boolean equals(Object obj) {
      if (obj != null) {
      if (this.getClass().equals(obj.getClass())) {
      MytmpPK that = (MytmpPK) obj;
      return (((this.subid == null) && (that.subid == null)) || (this.subid != null && this.subid.equals(that.subid)));
      }
      }
      return false;
      }
      public int hashCode() {
      return subid.hashCode();
      }
      }