From: Jon L. <jon...@xe...> - 2002-09-11 07:35:19
|
Hi Gavin (and all the rest), It appears to me that the onUpdate() method is not getting called when = it should. I have an object then implements the Lifecycle interface, = and I have run a simple test with it where I create an object, load an = object, update an object, and delete an object. Just for testing I = added "System.out" messages in each of the callbacks. The callbacks get = called for everything except for "onUpdate". Has anyone else noticed = this problem? Before I go digging around and trying to fix this, I wanted to make sure = no one else was working on it. Jon... PS - Is anyone working on adding outer join support for Oracle? If not, = then I'd like to volunteer to do this. |
From: Gavin K. <ga...@ap...> - 2002-09-11 07:49:09
|
> It appears to me that the onUpdate() method is not getting called when it should. onUpdate() gets called only when you explicitly pass a transient object to Session.update(). ie. its called when a transient object becomes "sessional". Its not called when an dirty object is UPDATEd on the database. I'm not sure if that is the source of some confusion, or if there is an actual bug. I know it seems to make sense to have a callback just before changes are persisted, and I spent a lot of time thinking about that. However, I decided that this was actually not a good idea for a number of reasons (I will describe them if you want but my girlie wants to us the computer now so I don't have time...) > Before I go digging around and trying to fix this, I wanted to make sure no one else was working on it. Yeah, could you please check thats its working as I described. There is a test for this but tests are not infallible. > PS - Is anyone working on adding outer join support for Oracle? If not, then I'd like to volunteer to do this. Yes, please. No-one is working on this AFAIK and I'm not planning to implement it myself. I'm playing around with a little ODMG-compliant API adaptor at the moment. Much less powerful API than Hibernate, because ODMG was designed as a lowest-common-denominator thing. But its is an established standard. Doesn't hurt to support it as an alternative. |
From: Jon L. <jon...@xe...> - 2002-09-11 07:58:15
|
Aah... That was the source of my confusion. I thought onUpdate would get called when a dirty object is updated in the database. I just ran a quick test, and it does indead work as you described when the object is transient between sessions. I can think of quite a few reasons myself why a callback before persisting changes doesn't make sense, but nonetheless it would have made my life really easy about now. ;-) Once I figure out a way to solve my callback problem in a different way, I will start working on the Oracle outer join stuff. Thanks, Jon... ----- Original Message ----- From: "Gavin King" <ga...@ap...> To: "Jon Lipsky" <jon...@xe...> Cc: "hibernate list" <hib...@li...> Sent: Wednesday, September 11, 2002 9:48 AM Subject: Re: [Hibernate] Question about onUpdate > > It appears to me that the onUpdate() method is not getting called when it > should. > > onUpdate() gets called only when you explicitly pass a transient object to > Session.update(). ie. its called when a transient object becomes > "sessional". Its not called when an dirty object is UPDATEd on the database. > I'm not sure if that is the source of some confusion, or if there is an > actual bug. > > I know it seems to make sense to have a callback just before changes are > persisted, and I spent a lot of time thinking about that. However, I decided > that this was actually not a good idea for a number of reasons (I will > describe them if you want but my girlie wants to us the computer now so I > don't have time...) > > > Before I go digging around and trying to fix this, I wanted to make sure > no one else was working on it. > > Yeah, could you please check thats its working as I described. There is a > test for this but tests are not infallible. > > > PS - Is anyone working on adding outer join support for Oracle? If not, > then I'd like to volunteer to do this. > > Yes, please. No-one is working on this AFAIK and I'm not planning to > implement it myself. > > > I'm playing around with a little ODMG-compliant API adaptor at the moment. > Much less powerful API than Hibernate, because ODMG was designed as a > lowest-common-denominator thing. But its is an established standard. Doesn't > hurt to support it as an alternative. > > > |