Hi, which version of OJB do you use?
Do a similar test - all works fine (with clearing cache or without clearing). The test: broker.beginTransaction(); Person p = new Person(); p.setFirstname("no_1_"+timestamp); p.setLastname("no_1_"+timestamp); broker.store(p); p.setFirstname("no_2_"+timestamp); p.setLastname("no_2_"+timestamp); broker.store(p); broker.commitTransaction(); Identity id = new Identity(p, broker); Person result = (Person) broker.getObjectByIdentity(id); assertNotNull(result); assertEquals("no_2_"+timestamp, result.getFirstname()); assertEquals("no_2_"+timestamp, result.getLastname()); regards, Armin ----- Original Message ----- From: "Ajitesh Das" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, July 04, 2003 9:33 PM Subject: inserting "reused" objects in a loop > When I am trying to "reuse" the object to "store" again, I am getting the > silent failure. If I create a new object before the failed store call, the > "store" method passes thro' fine. Does OJB marks the object as "already > used"? > The following code reproduces the issue: > broker = PersistenceBrokerFactory.defaultPersistenceBroker(); > broker.beginTransaction(); > Test zs = new Test(); > System.out.println("<<<1>>>Setting attributes of Test"); > zs.setPosX(30); > zs.setPosY(40); > broker.store(zs); > > // if I uncomment following statement, the 2nd "store" > // method works fine > // ts = new Test(); > > System.out.println("<<<2>>>Setting attributes of Test"); > zs.setPosX(31); > zs.setPosY(41); > broker.store(zs); // 2nd broker.store method call > broker.commitTransaction(); > the second call "broker.store()" fails silently and does not store > data directly. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]