cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcin Skladaniec <poldwusmo...@gmail.com>
Subject Re: very, very serious problem - null values where objects should be
Date Mon, 05 Jun 2006 21:35:39 GMT
I'm not sure how overriding getters and setters could stop cayenne  
from working. We are doing that too, and there are no problem (but we  
are using remote persistence).
In the first post you mentioned that getting related object does not  
work, now you are mentioning that set method is not running at all.  
What about get method, is it executed ?

 From what I understand your code when you set a value it shall fire  
an event to every listener, but not when you get value. I don't know  
why you would do it this way, what kinds of objects are listening to  
those changes ?
> (so
> that I can bind the beans to my GUI via jgoodies binding).
I'm probably wrong, but shouldn't you be firing events in DataObjects  
on get() to notify GUI on changes, and listen for events fired in GUI  
to set the values ?
Marcin


Marcin

On 06/06/2006, at 1:34 AM, Tomi NA wrote:

> On 6/5/06, Andrus Adamchik <andrus@objectstyle.org> wrote:
>>
>> On Jun 5, 2006, at 5:00 PM, Tomi NA wrote:
>>
>> > However, the complex event sequences, usage of a databinding  
>> framework
>> > coupled with classes generated with a modifed superclass template
>> > create a fairly hard to follow interaction. The breakpoint in the
>> > setToObjectGroup() method never catches anything, for instance.  
>> It is
>> > the usage environment that somehow nullifies parts of the object
>> > graph...
>>
>> You can go one step down - override 'DataObject.writeProperty' and
>> log the output when the property is 'toObjectGroup' and value is
>> 'null' (or even call Thread.dumpStack() to get the full stack trace
>> of the call).
>
> How would this provide more information than monitoring
> setToObjectGroup() execution? Where is writeProperty used outside of
> the setters?
> Still, I tried it and it isn't called. I just still receive null
> values. And it very amusing: I set the wanted object group in a
> dropdown, start the search for all object of the group and get the
> objects, but they can't reach back to the group (which they try to do
> when they display information about themselves).
> I overrid it like so (my break point on the "if" statement never
> caught anything):
>
>    public void writeProperty(String propName, Object val) {
>        super.writeProperty(propName, val);
>        if (val == null)  {
>            Thread.dumpStack();
>        }
>    }
>
>
>> If you still don't see any suspect invocations, this is probably
>> something related to serialization.
>
> Funny you should mention that: this is the first project I'm using
> serialization and plan to use it much more. To that end, I extended
> DataObject with a custom readResolve method:
>
>    protected Object readResolve() throws ObjectStreamException {
>     DataContext dc = Util.getDataContext();
>     return dc == null ? this : dc.localObject(getObjectId(), this);
>   }
>
> Still, judging from the wheres and hows I got null values, this does
> not seem to be the problem.
>
> I appreciate the help.
> t.n.a.


Mime
View raw message