Hi, ----- Original Message ----- From: "Ajitesh Das" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]>; "Armin Waibel" <[EMAIL PROTECTED]> Sent: Saturday, July 05, 2003 4:10 AM Subject: RE: inserting "reused" objects in a loop
> Hi Armin: > thanks for your reply. > I am using kind a old version : 0.9.8 > Was this a bug in that old version ? Don't know - maybe. There are several changes be made since 0.9.8. > Which one you are using in your test? Using CVS head (rc3 should work ditto). regards, Armin > I just tried your test code. Your test code does not work on 0.9.8 > If I do: > p = new Person(); > after the first store it works. > ~ajitesh > > > -----Original Message----- > From: Armin Waibel [mailto:[EMAIL PROTECTED] > Sent: Friday, July 04, 2003 2:06 PM > To: OJB Users List > Subject: Re: inserting "reused" objects in a loop > > > 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] > > --------------------------------------------------------------------- > 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]
