2 Replies Latest reply on Sep 21, 2001 7:21 PM by Juha Lindfors

    Not seeing updates in same TX?

    Tejaswi Kasturi Newbie

      I'm seeing this problem with JBoss 2.4.1 (and 2.4.1a and 2.2.2). This problem does NOT occur in 2.4.0, which leads me to believe it was fixed and then broke again:

      (This is all with CMP)

      (1) Start a TX
      (2) Update data on a bean (call it A, class MyBean) (for ex., set LinkID to 2 where it was 1 before)
      (3) Run a finder to retrieve all the MyBeans which match a certain criteria. (for ex., find all MyBeans where LinkID = 1).

      The finder shows the state of the beans before the update (for ex. the retrieved list still includes A, even though its LinkID has changed and is no longer equal to 1), even though it is in the same TX as the update. I should see the state of the table after the update.

      Am I misunderstanding what is supposed to happen or is this a problem with 2.4.1?

      Thank you,

        • 1. Re: Not seeing updates in same TX?
          Tejaswi Kasturi Newbie

          JBoss 3.0.0alpha as of today also has the correct behavior, like 2.4.0. Here's a snippet of code that I'm running in a transaction:

          public void go(long ID, long linkID) {
          try {
          EJBTest ejbtest = getEJBTest(ID);
          long origLinkID = ejbtest.getLinkID();
          Collection coll = getEJBTestByLinkID(origLinkID);
          for (Iterator i = coll.iterator(); i.hasNext(); ) {
           EJBTest test = (EJBTest) i.next();
           System.out.println("ID: " + test.getID() + " linkID: " + test.getLinkID());
          catch ...

          Starting with two entries:
          ID=1, LinkID=1
          ID=2, LinkID=1

          I run go in a tx with parameters (1, 2).
          In JBoss 2.4.0 (and 3.0.0alpha), the println returns:
          ID: 2 linkID: 1
          as it should
          In JBoss 2.4.1 (and 2.4.1a) it returns:
          ID: 1 linkID: 2
          ID: 2 linkID: 1

          which means the finder is not working correctly.

          Is this a bug in JBoss? Should I go ahead and put it on the bug list?

          • 2. Re: Not seeing updates in same TX?

            Submit as a bug. I think the behavior should be consistent across versions.