From: Gavin_King/Cirrus%<CI...@ci...> - 2002-08-27 01:56:39
|
>I'm having a problem with Session.update(). After performing a >Session.save() on an object, I change one property and call >Session.update() on it. Okay, just to be sure, because many new users think that you need to do this kind of thing: s = f.openSession(); Foo f = new Foo(); s.save(f); f.setBar("bar"); s.update(f); // unnecessary step!! s.flush(); s.connection.commit(); s.close(); I assume you are doing something like the following: s = f.openSession(); Foo f = new Foo(); s.save(f); s.flush(); s.connection.commit(); s.close(); f.setBar("bar"); s = f.openSession(); s.update(f); // necessary this time... s.flush(); s.connection.commit(); s.close(); >How is this possible given that it just saved the object correctly? Any >help would be appreciated. hmmm....youre going to have to give a bit more info than that..... like perhaps posting a mapping file + the actual code might be enough for me to spot the problem. (Best of all is to send a JUnit test that reproduces it, of course.) |