Hi Armin two instance different ??
-----Original Message----- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: mardi 23 décembre 2003 01:42 To: OJB Users List Subject: Re: reload Object ? ? (Problem Cache) Hi, in your example only 2 System.out.println(..) lines performed, but 3 lines are printed?! Do you forget one println() statement? regards, Armin Reda Benzair wrote: > Hi all, > > > > I have a -simple?- question about OJB cache: > > > > How can I force refreshing an object? Typically is there a method like > PB.refreshObject(Object o)? -I know of course this one doesn't exist...- > > > > To be more precise, I have someting like this: > > PersistenceBroker pb = > PersistenceBrokerFactory.createPersistenceBroker("jcd", "user", "pass"); > Criteria crit = new Criteria(); > crit.addEqualTo("Id", new Integer(505)); > Employee employee505 = (Employee) pb.getObjectByQuery(new > QueryByCriteria(Employee.class, crit)); > --------------------------> First print System.out.println("ID 505 = " + employee505.getName() + " " +employee505); > > employee505.setName("MODIFIED " + employee505.getName()); -------------------------> print 2 System.out.println("AFTER MODIF :\t505 = " + emp.getName () + " \t(" + emp + ")"); System.out.println("Remove from cache..."); --------------------> modified but not stored... should be erased by remove + reload? >>>>>>>>> pb.removeFromCache(employee505); > employee505 = (Employee) pb.getObjectByQuery(new > QueryByCriteria(Employee.class, crit)); > > System.out.println("505 = " + employee505.getName() + " " + > employee505); > > > > The standard output is: > > 505 = John Doe [EMAIL PROTECTED] > > 505 = MODIFIED john Doe [EMAIL PROTECTED] > > 505 = John Doe [EMAIL PROTECTED] > > And I would have liked line2 to be exactly equal to line1. Where am I > wrong? > > > > Thank you very much by advance, since this blocks my team on the > production environment... > > > > --------------------------------------------------------------------- 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]