Hi
I'm getting some strange errors in my app. It started as a StaleObjectStateException and after some analysis I think I know a bit more of why this happens.
At one point in my logic I use a criteria query to find Balance objects. In my app, Balance objects are connected to Account objects. One of the Restrictions of the criteria query specifically points to one specific Account object that the Balance should be connected to. When the criteria query is run, it seems that it creates another Account object with the same data as the one used in as a parameter in the Restriction. This other object is connected to the Balance object. Because of this, there are two objects around representing the same thing and this leads to problems...
So, Is there any way I can set up my Hibernate environment so that it is actually the object passed as a parameter that is connected to the returned Balance object and not a newly created one?
|