Uploaded image for project: 'OJB'
  1. OJB
  2. OJB-29

Infinite loop in case of refresh=true and cycles in references

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0.3
    • 1.0.4
    • PB-API
    • None

    Description

      Hi Armin,
      I have attached the objects I try to persist, the sql to generate the database and the repository xml in the zip file which I will attach shortly. I execute the code below to get a loop (and a stack overflow).

      Let me know if my setup is wrong.

      Good luck!

      gr. Martin

      PersistenceBroker broker = null;
      try
      {
      broker = PersistenceBrokerFactory.createPersistenceBroker(pbkey);

      { final A myA = new A(); final B myB = new B(); myA.setName("I am a"); myA.setMyB(myB); myB.setName("I am b"); myB.setMyA(myA); broker.beginTransaction(); broker.store(myA); broker.store(myB); broker.commitTransaction(); }

      // now read again

      { broker.clearCache(); Criteria criteria = new Criteria(); criteria.addEqualTo("Name", "I am a"); QueryByCriteria query = QueryFactory.newQuery(A.class, criteria); A myA = (A)broker.getObjectByQuery(query); // Here it loops (and stops with a stack overflow) assertTrue(myA.getMyB().getName().compareTo("I am b") == 0); }

      }
      finally

      { if (broker != null) broker.close(); }

      Attachments

        1. testcasesimple.zip
          13 kB
          Martin Taal

        Activity

          People

            arminw Armin Waibel
            mtaal Martin Taal
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: