11 Replies Latest reply on Nov 16, 2001 1:57 PM by Dan Christopherson

    Big Trouble!! Problem with finder methods.

    Bani Greyling Newbie

      Hi,

      I use CMP on JBoss2.4.1a_Tomcat3.2.3 and MSSql Server 2000.

      For this specific bean I have an additional finder method named findByAccountNo. I do not specify the where clause, but rely on JBoss's ability to figure the column name from the findBy method. If, however, I have findByPrimaryKey and findByAccountNo returning me the same object and I make changes to the one object, the changes do not reflect on the object returned by the other method. The processflow (in psuedo-code)would typically be:

      1)Object a = findByAccountNo("ANACCTNO"); (Returning only one object in the collection)
      2)findByPrimaryKey(new PK("ABC","ANACCTNO"));
      3)a.setSomething("QWERTY");
      4)Object b = findByPrimaryKey(new PK("ABC","ANACCTNO"));

      Where
      a.getPK.equals(b.getPK) evaluates true

      **** BUT I FIND THAT ***

      a.getSomething().equals(b.getSomething()) evaluates false

      which IMHO is a serious BUG.

      Should you go to the trouble of getting the monitor application working, you will notice that the cache for this bean have two active instances although there is only one row in the database!

      I really hope someone can either proof me wrong or fix it.

      Regards
      Bani