cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tomi NA" <hef...@gmail.com>
Subject Re: very, very serious problem - null values where objects should be
Date Mon, 05 Jun 2006 15:34:44 GMT
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